From ccd6111c2415fc357944464cdf51ab496364241c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 19 Jun 2011 22:51:47 -0700 Subject: * font.c (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. --- src/font.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/font.c') diff --git a/src/font.c b/src/font.c index b9cdde376a5..cc57af12141 100644 --- a/src/font.c +++ b/src/font.c @@ -232,9 +232,9 @@ static int num_font_drivers; 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; @@ -247,7 +247,12 @@ font_intern_prop (const char *str, int len, int force_symbol) 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 -- cgit v1.2.1