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