Blame SOURCES/file-5.11-CVE-2018-10360.patch

89be67
From 8616080aecf07436e80a27f68c336382c1d1c22d Mon Sep 17 00:00:00 2001
89be67
From: Christos Zoulas <christos@zoulas.com>
89be67
Date: Sat, 9 Jun 2018 16:00:06 +0000
89be67
Subject: [PATCH] Avoid reading past the end of buffer (Rui Reis)
89be67
89be67
Upstream-commit: a642587a9c9e2dd7feacdf513c3643ce26ad3c22
89be67
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
89be67
---
89be67
 src/readelf.c | 3 ++-
89be67
 1 file changed, 2 insertions(+), 1 deletion(-)
89be67
89be67
diff --git a/src/readelf.c b/src/readelf.c
89be67
index 3df0836..d96a538 100644
89be67
--- a/src/readelf.c
89be67
+++ b/src/readelf.c
89be67
@@ -966,7 +966,8 @@ core:
89be67
 
89be67
 				cname = (unsigned char *)
89be67
 				    &nbuf[doff + prpsoffsets(i)];
89be67
-				for (cp = cname; *cp && isprint(*cp); cp++)
89be67
+				for (cp = cname; cp < nbuf + size && *cp
89be67
+				    && isprint(*cp); cp++)
89be67
 					continue;
89be67
 				/*
89be67
 				 * Linux apparently appends a space at the end
89be67
-- 
89be67
2.14.4
89be67