Subject: bug#74555: closed (Re: bug#74555: fix not checking if fixnat in Fmap_charset_chars)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 30 Nov 2024 10:57:02 +0000

Your bug report

#74555: fix not checking if fixnat in Fmap_charset_chars

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74555: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74555
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#74555: fix not checking if fixnat in Fmap_charset_chars
From: Eli Zaretskii <[email-masked]>
To: altermo31 <[email-masked]>
Cc: [email-masked]
Date: Sat, 30 Nov 2024 12:56:24 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> Date: Wed, 27 Nov 2024 09:41:48 +0000
> From:  altermo31 via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> 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.

Thanks, installed on the master branch, and closing the bug.

Subject: fix not checking if fixnat in Fmap_charset_chars
From: altermo31 <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Wed, 27 Nov 2024 09:41:48 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

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