From 54e89f45560a3e73e172061a5551cf56b049256d Mon Sep 17 00:00:00 2001
From: lingsheng <lingsheng1@h-partners.com>
Date: Tue, 24 Sep 2024 11:34:58 +0000
Subject: [PATCH] fix CVE-2024-4141

Origin:https://bugzilla.suse.com/show_bug.cgi?id=1223375#c3
---
 fofi/FoFiType1.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index a4d82f2..dbb502c 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -212,7 +212,8 @@ void FoFiType1::parse() {
   char *line, *line1, *firstLine, *p, *p2;
   char buf[256];
   char c;
-  int n, code, base, i, j;
+  unsigned int code;
+  int n, base, i, j;
   char *tokptr;
   bool gotMatrix, continueLine;
 
@@ -304,7 +305,7 @@ void FoFiType1::parse() {
 	    }
 	    ++p;
 	    for (p2 = p; *p2 && *p2 != ' ' && *p2 != '\t'; ++p2) ;
-	    if (code >= 0 && code < 256) {
+	    if (code < 256) {
 	      c = *p2;
 	      *p2 = '\0';
 	      gfree(encoding[code]);
-- 
2.33.0

