From: Paul Eggert Date: Sat, 18 Jun 2011 16:04:07 +0000 (-0700) Subject: * fns.c: Check that character arg fits in 'int'. X-Git-Tag: emacs-pretest-24.0.90~104^2~473^2~55 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a4cf38e4bad869b1dc6af9c0b61b3e06da157dd3;p=emacs.git * fns.c: Check that character arg fits in 'int'. --- diff --git a/src/ChangeLog b/src/ChangeLog index ee582c4e4a0..4ce871b7288 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -3,6 +3,7 @@ * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'. Use much-faster test for byte-length change. Don't assume string byte-length fits in 'int'. + Check that character arg fits in 'int'. * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication. diff --git a/src/fns.c b/src/fns.c index 51b753b3134..702ecbd7c63 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2141,7 +2141,6 @@ ARRAY is a vector, string, char-table, or bool-vector. */) (Lisp_Object array, Lisp_Object item) { register EMACS_INT size, idx; - int charval; if (VECTORP (array)) { @@ -2161,8 +2160,9 @@ ARRAY is a vector, string, char-table, or bool-vector. */) else if (STRINGP (array)) { register unsigned char *p = SDATA (array); - CHECK_NUMBER (item); - charval = XINT (item); + int charval; + CHECK_CHARACTER (item); + charval = XFASTINT (item); size = SCHARS (array); if (STRING_MULTIBYTE (array)) {