diff options
| author | Paul Eggert | 2011-07-13 23:20:53 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-13 23:20:53 -0700 |
| commit | ca4aa9359160557f8103639fc3c0ccb16c6ba8d2 (patch) | |
| tree | 5b939640079b6fe042c9509fb0d03bb72495aa2a /src/ChangeLog | |
| parent | 5f8f9cc26998b1b74d9ac5c8b68000d53aae31cc (diff) | |
| download | emacs-ca4aa9359160557f8103639fc3c0ccb16c6ba8d2.tar.gz emacs-ca4aa9359160557f8103639fc3c0ccb16c6ba8d2.zip | |
* image.c: Improve checking for integer overflow.
(check_image_size): Assume that f is nonnull, since
it is always nonnull in practice. This is one less thing to
worry about when checking for integer overflow later.
(x_check_image_size): New function, which checks for integer
overflow issues inside X.
(x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
This removes the need for a memory_full check.
(xbm_image_p): Rewrite to avoid integer multiplication overflow.
(Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
(xbm_read_bitmap_data): Change locals back to 'int', since
their values must fit in 'int'.
(xpm_load_image, png_load, tiff_load):
Invoke x_create_x_image_and_pixmap earlier,
to avoid much needless work if the image is too large.
(tiff_load): Treat overly large images as if
x_create_x_image_and_pixmap failed, not as malloc failures.
(gs_load): Use x_check_image_size.
Diffstat (limited to 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index c986030fcf8..e07b906b56d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,24 @@ | |||
| 1 | 2011-07-14 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * image.c: Improve checking for integer overflow. | ||
| 4 | (check_image_size): Assume that f is nonnull, since | ||
| 5 | it is always nonnull in practice. This is one less thing to | ||
| 6 | worry about when checking for integer overflow later. | ||
| 7 | (x_check_image_size): New function, which checks for integer | ||
| 8 | overflow issues inside X. | ||
| 9 | (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it. | ||
| 10 | This removes the need for a memory_full check. | ||
| 11 | (xbm_image_p): Rewrite to avoid integer multiplication overflow. | ||
| 12 | (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size. | ||
| 13 | (xbm_read_bitmap_data): Change locals back to 'int', since | ||
| 14 | their values must fit in 'int'. | ||
| 15 | (xpm_load_image, png_load, tiff_load): | ||
| 16 | Invoke x_create_x_image_and_pixmap earlier, | ||
| 17 | to avoid much needless work if the image is too large. | ||
| 18 | (tiff_load): Treat overly large images as if | ||
| 19 | x_create_x_image_and_pixmap failed, not as malloc failures. | ||
| 20 | (gs_load): Use x_check_image_size. | ||
| 21 | |||
| 1 | 2011-07-13 Paul Eggert <eggert@cs.ucla.edu> | 22 | 2011-07-13 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 23 | ||
| 3 | * gtkutil.c: Omit integer casts. | 24 | * gtkutil.c: Omit integer casts. |