Add more error-checking to Fmap_charset_chars

* 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
This commit is contained in:
altermo 2024-11-27 10:37:28 +01:00 committed by Eli Zaretskii
parent 8ef44ca64e
commit 2125e188ad

View 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);