aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/image.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e1e9e24fcba..7f174bf0a21 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12011-06-23 Paul Eggert <eggert@cs.ucla.edu>
2
3 * image.c (cache_image): Check for size arithmetic overflow.
4
12011-06-22 Paul Eggert <eggert@cs.ucla.edu> 52011-06-22 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 * lread.c: Integer overflow issues. 7 * lread.c: Integer overflow issues.
diff --git a/src/image.c b/src/image.c
index a9785e5d00f..6e8440fb431 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1836,6 +1836,8 @@ cache_image (struct frame *f, struct image *img)
1836 /* If no free slot found, maybe enlarge c->images. */ 1836 /* If no free slot found, maybe enlarge c->images. */
1837 if (i == c->used && c->used == c->size) 1837 if (i == c->used && c->used == c->size)
1838 { 1838 {
1839 if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *c->images / 2 < c->size)
1840 memory_full (SIZE_MAX);
1839 c->size *= 2; 1841 c->size *= 2;
1840 c->images = (struct image **) xrealloc (c->images, 1842 c->images = (struct image **) xrealloc (c->images,
1841 c->size * sizeof *c->images); 1843 c->size * sizeof *c->images);