Subject: bug#74555: fix not checking if fixnat in Fmap_charset_chars

From: altermo31 <[email-masked]>
Date: Wed, 27 Nov 2024 09:41:48 +0000

Problem:
Fmap_charset_chars's arguments from_code and to_code may be converted to unsigned numbers even if they're not fixnat.

Sulution:
Check that their fixnat.

From 8d036862b48d57a5a848f1c0ebd4fd6c613539ca Mon Sep 17 00:00:00 2001
From: altermo <[email-masked]>
Date: Wed, 27 Nov 2024 10:37:28 +0100
Subject: [PATCH] Fix not checking if fixnat

---
 src/charset.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/charset.c b/src/charset.c
index f7d80cc..37d08f2 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -819,6 +819,7 @@ TO-CODE, which are CHARSET code points.  */)
     from = CHARSET_MIN_CODE (cs);
   else
     {
+      CHECK_FIXNAT(from_code);
       from = XFIXNUM (from_code);
       if (from < CHARSET_MIN_CODE (cs))
 	from = CHARSET_MIN_CODE (cs);
@@ -827,6 +828,7 @@ TO-CODE, which are CHARSET code points.  */)
     to = CHARSET_MAX_CODE (cs);
   else
     {
+      CHECK_FIXNAT(to_code);
       to = XFIXNUM (to_code);
       if (to > CHARSET_MAX_CODE (cs))
 	to = CHARSET_MAX_CODE (cs);
-- 
2.47.1