Don't assume integer property fits in fixnum.
* font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
* font.c: Don't assume string length fits in int.
(font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
Use ptrdiff_t, not int.
+ (font_intern_prop): Don't assume string length fits in int.
+ Don't assume integer property fits in fixnum.
+ * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
* filelock.c: Fix some buffer overrun and integer overflow issues.
(get_boot_time): Don't assume that gzip command string fits in 100 bytes.
STR. */
Lisp_Object
-font_intern_prop (const char *str, int len, int force_symbol)
+font_intern_prop (const char *str, ptrdiff_t len, int force_symbol)
{
- int i;
+ ptrdiff_t i;
Lisp_Object tem;
Lisp_Object obarray;
EMACS_INT nbytes, nchars;
if (! isdigit (str[i]))
break;
if (i == len)
- return make_number (atoi (str));
+ {
+ Lisp_Object num = string_to_number (str, 10, 0);
+ if (! INTEGERP (num))
+ xsignal1 (Qoverflow_error, num);
+ return num;
+ }
}
/* The following code is copied from the function intern (in
extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec);
extern Lisp_Object font_open_by_name (FRAME_PTR f, const char *name);
-extern Lisp_Object font_intern_prop (const char *str, int len, int force_symbol);
+extern Lisp_Object font_intern_prop (const char *str, ptrdiff_t len,
+ int force_symbol);
extern void font_update_sort_order (int *order);
extern void font_parse_family_registry (Lisp_Object family,