diff options
| author | Eli Zaretskii | 2012-04-20 17:08:55 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-04-20 17:08:55 +0300 |
| commit | 73055685ff9e9d3557ab378e276d42d82952ac7c (patch) | |
| tree | 68dd014c09f1b39bf287c9794bb920277ef46916 /src | |
| parent | 9ee9f4709c53bbf1240a8f4169674172dd458030 (diff) | |
| download | emacs-73055685ff9e9d3557ab378e276d42d82952ac7c.tar.gz emacs-73055685ff9e9d3557ab378e276d42d82952ac7c.zip | |
Fix bug #11288 with overrunning array limits.
src/dispnew.c (swap_glyph_pointers, copy_row_except_pointers): Don't
overrun array limits of glyph row's used[] array.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/dispnew.c | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 18b6ce1ad64..c232420d0b1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-04-20 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * dispnew.c (swap_glyph_pointers, copy_row_except_pointers): Don't | ||
| 4 | overrun array limits of glyph row's used[] array. (Bug#11288) | ||
| 5 | |||
| 1 | 2012-04-20 Chong Yidong <cyd@gnu.org> | 6 | 2012-04-20 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * process.c (wait_reading_process_output): If EIO occurs on a pty, | 8 | * process.c (wait_reading_process_output): If EIO occurs on a pty, |
diff --git a/src/dispnew.c b/src/dispnew.c index 02d6de53bbf..b313852efe2 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -1085,12 +1085,16 @@ swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b) | |||
| 1085 | for (i = 0; i < LAST_AREA + 1; ++i) | 1085 | for (i = 0; i < LAST_AREA + 1; ++i) |
| 1086 | { | 1086 | { |
| 1087 | struct glyph *temp = a->glyphs[i]; | 1087 | struct glyph *temp = a->glyphs[i]; |
| 1088 | short used_tem = a->used[i]; | ||
| 1089 | 1088 | ||
| 1090 | a->glyphs[i] = b->glyphs[i]; | 1089 | a->glyphs[i] = b->glyphs[i]; |
| 1091 | b->glyphs[i] = temp; | 1090 | b->glyphs[i] = temp; |
| 1092 | a->used[i] = b->used[i]; | 1091 | if (i < LAST_AREA) |
| 1093 | b->used[i] = used_tem; | 1092 | { |
| 1093 | short used_tem = a->used[i]; | ||
| 1094 | |||
| 1095 | a->used[i] = b->used[i]; | ||
| 1096 | b->used[i] = used_tem; | ||
| 1097 | } | ||
| 1094 | } | 1098 | } |
| 1095 | a->hash = b->hash; | 1099 | a->hash = b->hash; |
| 1096 | b->hash = hash_tem; | 1100 | b->hash = hash_tem; |
| @@ -1105,7 +1109,7 @@ static inline void | |||
| 1105 | copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from) | 1109 | copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from) |
| 1106 | { | 1110 | { |
| 1107 | struct glyph *pointers[1 + LAST_AREA]; | 1111 | struct glyph *pointers[1 + LAST_AREA]; |
| 1108 | short used[1 + LAST_AREA]; | 1112 | short used[LAST_AREA]; |
| 1109 | unsigned hashval; | 1113 | unsigned hashval; |
| 1110 | 1114 | ||
| 1111 | /* Save glyph pointers of TO. */ | 1115 | /* Save glyph pointers of TO. */ |