Blame SOURCES/0028-Fix-for-CVE-2021-25217.patch

f9ed25
From 02b4ae1953d39f1b6c3f0e63aefb72114039ab50 Mon Sep 17 00:00:00 2001
f9ed25
From: Pavel Zhukov <pzhukov@redhat.com>
f9ed25
Date: Tue, 22 Jun 2021 06:56:29 +0200
f9ed25
Subject: [PATCH 28/29] Fix for  CVE-2021-25217
f9ed25
Cc: pzhukov@redhat.com
f9ed25
f9ed25
---
f9ed25
 common/parse.c | 5 +++--
f9ed25
 1 file changed, 3 insertions(+), 2 deletions(-)
f9ed25
f9ed25
diff --git a/common/parse.c b/common/parse.c
f9ed25
index f17bc0b..4e8b408 100644
f9ed25
--- a/common/parse.c
f9ed25
+++ b/common/parse.c
f9ed25
@@ -5587,13 +5587,14 @@ int parse_X (cfile, buf, max)
f9ed25
 				skip_to_semi (cfile);
f9ed25
 				return 0;
f9ed25
 			}
f9ed25
-			convert_num (cfile, &buf [len], val, 16, 8);
f9ed25
-			if (len++ > max) {
f9ed25
+			if (len >= max) {
f9ed25
 				parse_warn (cfile,
f9ed25
 					    "hexadecimal constant too long.");
f9ed25
 				skip_to_semi (cfile);
f9ed25
 				return 0;
f9ed25
 			}
f9ed25
+			convert_num (cfile, &buf [len], val, 16, 8);
f9ed25
+			len++;
f9ed25
 			token = peek_token (&val, (unsigned *)0, cfile);
f9ed25
 			if (token == COLON)
f9ed25
 				token = next_token (&val,
f9ed25
-- 
f9ed25
2.26.3
f9ed25