diff options
| author | Paul Eggert | 2011-06-03 12:02:25 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-03 12:02:25 -0700 |
| commit | 201f31ae3de0b747b47863b93d6f6a747c36c960 (patch) | |
| tree | 800c2c66fc648660cb957df676ea59cc911ae0fa /src/ChangeLog | |
| parent | be14b9ab109c8deb5745dc47cbc471e97be06486 (diff) | |
| download | emacs-201f31ae3de0b747b47863b93d6f6a747c36c960.tar.gz emacs-201f31ae3de0b747b47863b93d6f6a747c36c960.zip | |
Check for overflow when converting integer to cons and back.
* charset.c (Fdefine_charset_internal, Fdecode_char):
Use cons_to_unsigned to catch overflow.
(Fencode_char): Use INTEGER_TO_CONS.
* composite.h (LGLYPH_CODE): Use cons_to_unsigned.
(LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
* data.c (long_to_cons, cons_to_long): Remove.
(cons_to_unsigned, cons_to_signed): New functions.
These signal an error for invalid or out-of-range values.
* dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
* fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
* font.c (Ffont_variation_glyphs):
* fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
* lisp.h (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
(cons_to_signed, cons_to_unsigned): New decls.
(long_to_cons, cons_to_long): Remove decls.
* undo.c (record_first_change): Use INTEGER_TO_CONS.
(Fprimitive_undo): Use CONS_TO_INTEGER.
* xfns.c (Fx_window_property): Likewise.
* xselect.c (x_own_selection, selection_data_to_lisp_data):
Use INTEGER_TO_CONS.
(x_handle_selection_request, x_handle_selection_clear)
(x_get_foreign_selection, Fx_disown_selection_internal)
(Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
(lisp_data_to_selection_data): Use cons_to_unsigned.
(x_fill_property_data): Use cons_to_signed. Report values out of range.
Diffstat (limited to 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 857600fda0c..20308d40ab0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,32 @@ | |||
| 1 | 2011-06-03 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-06-03 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | Check for overflow when converting integer to cons and back. | ||
| 4 | * charset.c (Fdefine_charset_internal, Fdecode_char): | ||
| 5 | Use cons_to_unsigned to catch overflow. | ||
| 6 | (Fencode_char): Use INTEGER_TO_CONS. | ||
| 7 | * composite.h (LGLYPH_CODE): Use cons_to_unsigned. | ||
| 8 | (LGLYPH_SET_CODE): Use INTEGER_TO_CONS. | ||
| 9 | * data.c (long_to_cons, cons_to_long): Remove. | ||
| 10 | (cons_to_unsigned, cons_to_signed): New functions. | ||
| 11 | These signal an error for invalid or out-of-range values. | ||
| 12 | * dired.c (Ffile_attributes): Use INTEGER_TO_CONS. | ||
| 13 | * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER. | ||
| 14 | * font.c (Ffont_variation_glyphs): | ||
| 15 | * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS. | ||
| 16 | * lisp.h (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros. | ||
| 17 | (cons_to_signed, cons_to_unsigned): New decls. | ||
| 18 | (long_to_cons, cons_to_long): Remove decls. | ||
| 19 | * undo.c (record_first_change): Use INTEGER_TO_CONS. | ||
| 20 | (Fprimitive_undo): Use CONS_TO_INTEGER. | ||
| 21 | * xfns.c (Fx_window_property): Likewise. | ||
| 22 | * xselect.c (x_own_selection, selection_data_to_lisp_data): | ||
| 23 | Use INTEGER_TO_CONS. | ||
| 24 | (x_handle_selection_request, x_handle_selection_clear) | ||
| 25 | (x_get_foreign_selection, Fx_disown_selection_internal) | ||
| 26 | (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER. | ||
| 27 | (lisp_data_to_selection_data): Use cons_to_unsigned. | ||
| 28 | (x_fill_property_data): Use cons_to_signed. Report values out of range. | ||
| 29 | |||
| 3 | Fix doc for machines with wider system times such as time_t. | 30 | Fix doc for machines with wider system times such as time_t. |
| 4 | On such machines, it's now safe to assume that EMACS_INT is as | 31 | On such machines, it's now safe to assume that EMACS_INT is as |
| 5 | wide as the system times, so that shifting right by 16 will | 32 | wide as the system times, so that shifting right by 16 will |