Blame SOURCES/0001-fix-file-name-buffer-overflow-in-isoinfo.patch

395898
From 05c639c8a0f61da73ca8f1f725f8f5394d8bf15f Mon Sep 17 00:00:00 2001
395898
From: Jakub Martisko <jamartis@redhat.com>
395898
Date: Thu, 2 Aug 2018 09:34:18 +0200
395898
Subject: [PATCH] fix: file name buffer overflow in isoinfo
395898
395898
---
395898
 genisoimage/diag/isoinfo.c | 10 ++++++++++
395898
 1 file changed, 10 insertions(+)
395898
395898
diff --git a/genisoimage/diag/isoinfo.c b/genisoimage/diag/isoinfo.c
395898
index 3cc2678..a08141d 100644
395898
--- a/genisoimage/diag/isoinfo.c
395898
+++ b/genisoimage/diag/isoinfo.c
395898
@@ -763,6 +763,11 @@ parse_dir(char *rootname, int extent, int len)
395898
 				strcat(td->name, name_buf);
395898
 				strcat(td->name, "/");
395898
 			} else {
395898
+				if ( (PATH_MAX - strlen(rootname)) < strlen(name_buf))
395898
+				{
395898
+					fprintf(stderr, "Name too long: %s%s\n", rootname, name_buf);
395898
+					exit(1);
395898
+				}	
395898
 				strcpy(testname, rootname);
395898
 				strcat(testname, name_buf);
395898
 				if (xtract && strcmp(xtract, testname) == 0) {
395898
@@ -772,6 +777,11 @@ parse_dir(char *rootname, int extent, int len)
395898
 			if (do_find &&
395898
 			    (idr->name_len[0] != 1 ||
395898
 			    (idr->name[0] != 0 && idr->name[0] != 1))) {
395898
+				if ( (PATH_MAX - strlen(rootname)) < strlen(name_buf))
395898
+				{
395898
+					fprintf(stderr, "Name too long: %s%s\n", rootname, name_buf);
395898
+					exit(1);
395898
+				}	
395898
 				strcpy(testname, rootname);
395898
 				strcat(testname, name_buf);
395898
 				printf("%s\n", testname);
395898
-- 
395898
2.14.4
395898