24c04c
From f22593b82b5d1668d1997dbccd10a9c31ffea3b3 Mon Sep 17 00:00:00 2001
24c04c
From: Dov Grobgeld <dov.grobgeld@gmail.com>
24c04c
Date: Fri, 25 Mar 2022 09:09:49 +0300
24c04c
Subject: [PATCH 2/4] Protected against garbage in the CapRTL encoder
24c04c
24c04c
---
24c04c
 lib/fribidi-char-sets-cap-rtl.c | 7 ++++++-
24c04c
 1 file changed, 6 insertions(+), 1 deletion(-)
24c04c
24c04c
diff --git a/lib/fribidi-char-sets-cap-rtl.c b/lib/fribidi-char-sets-cap-rtl.c
24c04c
index b0c0e4a..f74e010 100644
24c04c
--- a/lib/fribidi-char-sets-cap-rtl.c
24c04c
+++ b/lib/fribidi-char-sets-cap-rtl.c
24c04c
@@ -232,7 +232,12 @@ fribidi_cap_rtl_to_unicode (
24c04c
 	    }
24c04c
 	}
24c04c
       else
24c04c
-	us[j++] = caprtl_to_unicode[(int) s[i]];
24c04c
+      {
24c04c
+        if ((int)s[i] < 0)
24c04c
+          us[j++] = '?';
24c04c
+        else
24c04c
+          us[j++] = caprtl_to_unicode[(int) s[i]];
24c04c
+      }
24c04c
     }
24c04c
 
24c04c
   return j;
24c04c
-- 
24c04c
2.35.1
24c04c