diff options
| author | Paul Eggert | 2011-06-18 09:04:07 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-18 09:04:07 -0700 |
| commit | a4cf38e4bad869b1dc6af9c0b61b3e06da157dd3 (patch) | |
| tree | b5071585a690079f22c2e289628a98f30ea1296a /src | |
| parent | 311d5d7cc63a9f2d4823066f82faeb4fb6203710 (diff) | |
| download | emacs-a4cf38e4bad869b1dc6af9c0b61b3e06da157dd3.tar.gz emacs-a4cf38e4bad869b1dc6af9c0b61b3e06da157dd3.zip | |
* fns.c: Check that character arg fits in 'int'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 1 | ||||
| -rw-r--r-- | src/fns.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ee582c4e4a0..4ce871b7288 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'. | 3 | * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'. |
| 4 | Use much-faster test for byte-length change. | 4 | Use much-faster test for byte-length change. |
| 5 | Don't assume string byte-length fits in 'int'. | 5 | Don't assume string byte-length fits in 'int'. |
| 6 | Check that character arg fits in 'int'. | ||
| 6 | 7 | ||
| 7 | * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication. | 8 | * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication. |
| 8 | 9 | ||
| @@ -2141,7 +2141,6 @@ ARRAY is a vector, string, char-table, or bool-vector. */) | |||
| 2141 | (Lisp_Object array, Lisp_Object item) | 2141 | (Lisp_Object array, Lisp_Object item) |
| 2142 | { | 2142 | { |
| 2143 | register EMACS_INT size, idx; | 2143 | register EMACS_INT size, idx; |
| 2144 | int charval; | ||
| 2145 | 2144 | ||
| 2146 | if (VECTORP (array)) | 2145 | if (VECTORP (array)) |
| 2147 | { | 2146 | { |
| @@ -2161,8 +2160,9 @@ ARRAY is a vector, string, char-table, or bool-vector. */) | |||
| 2161 | else if (STRINGP (array)) | 2160 | else if (STRINGP (array)) |
| 2162 | { | 2161 | { |
| 2163 | register unsigned char *p = SDATA (array); | 2162 | register unsigned char *p = SDATA (array); |
| 2164 | CHECK_NUMBER (item); | 2163 | int charval; |
| 2165 | charval = XINT (item); | 2164 | CHECK_CHARACTER (item); |
| 2165 | charval = XFASTINT (item); | ||
| 2166 | size = SCHARS (array); | 2166 | size = SCHARS (array); |
| 2167 | if (STRING_MULTIBYTE (array)) | 2167 | if (STRING_MULTIBYTE (array)) |
| 2168 | { | 2168 | { |