Commit ae063414 authored by Paul Eggert's avatar Paul Eggert

Fix string-to-number C-level mishandling

* src/sysdep.c (list_system_processes):
* src/xfaces.c (Finternal_set_lisp_face_attribute_from_resource):
Defend against Fstring_to_number returning a float or a nonsense
integer.
parent 94a59a6d
......@@ -3006,7 +3006,11 @@ list_system_processes (void)
for (tail = proclist; CONSP (tail); tail = next)
{
next = XCDR (tail);
XSETCAR (tail, Fstring_to_number (XCAR (tail), Qnil));
Lisp_Object pidstring = XCAR (tail);
Lisp_Object pid = Fstring_to_number (pidstring, Qnil);
if (!INTEGERP (pid) || XINT (pid) <= 0)
xsignal1 (Qoverflow_error, pidstring);
XSETCAR (tail, pid);
}
/* directory_files_internal returns the files in reverse order; undo
......
......@@ -3393,7 +3393,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource",
else if (EQ (attr, QCheight))
{
value = Fstring_to_number (value, make_number (10));
if (XINT (value) <= 0)
if (!INTEGERP (value) || XINT (value) <= 0)
signal_error ("Invalid face height from X resource", value);
}
else if (EQ (attr, QCbold) || EQ (attr, QCitalic))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment