]> git.eshelyaron.com Git - emacs.git/commitdiff
Add more error-checking to Fmap_charset_chars
authoraltermo <107814000+altermo@users.noreply.github.com>
Wed, 27 Nov 2024 09:37:28 +0000 (10:37 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 4 Dec 2024 17:01:31 +0000 (18:01 +0100)
* src/charset.c (Fmap_charset_chars): Signal an error if FROM_CODE
or TO_CODE is non-nil and not a fixnum.  (Bug#74555)

Copyright-paperwork-exempt: yes
(cherry picked from commit 2125e188ad806134dfc81408822208d75d7f3b5a)

src/charset.c

index f7d80cc3f3e640997c19dc7c7c84d7c5abd4b720..37d08f249c75646bd199783166e4752b0773977d 100644 (file)
@@ -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);