diff options
| author | Paul Eggert | 2011-07-28 14:31:33 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-28 14:31:33 -0700 |
| commit | ca9ce8f2cb9d3d70c4e7d9dc9299ea4d5d71dfbc (patch) | |
| tree | e4e42ca73a6f80d97ff9a3f1b224699e1336bc43 /src/dispextern.h | |
| parent | 7bd4252299e9ed464cac124ac1ff718c98396df2 (diff) | |
| download | emacs-ca9ce8f2cb9d3d70c4e7d9dc9299ea4d5d71dfbc.tar.gz emacs-ca9ce8f2cb9d3d70c4e7d9dc9299ea4d5d71dfbc.zip | |
Integer and memory overflow fixes for display code.
* dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
* dispnew.c (adjust_glyph_matrix, realloc_glyph_pool, scrolling_window):
Check for overflow in size calculations.
(line_draw_cost, realloc_glyph_pool, add_row_entry):
Don't assume glyph table len fits in int.
(struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
(row_table_size): Now ptrdiff_t, not int.
(scrolling_window): Avoid overflow in size calculations.
Don't update size until allocation succeeds.
* fns.c (concat): Check for overflow in size calculations.
(next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
* lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
(NEXT_ALMOST_PRIME_LIMIT): New constant.
Diffstat (limited to 'src/dispextern.h')
| -rw-r--r-- | src/dispextern.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 1d7bf5d53ec..70f426f95a6 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -575,7 +575,7 @@ struct glyph_pool | |||
| 575 | struct glyph *glyphs; | 575 | struct glyph *glyphs; |
| 576 | 576 | ||
| 577 | /* Allocated size of `glyphs'. */ | 577 | /* Allocated size of `glyphs'. */ |
| 578 | int nglyphs; | 578 | ptrdiff_t nglyphs; |
| 579 | 579 | ||
| 580 | /* Number of rows and columns in a matrix. */ | 580 | /* Number of rows and columns in a matrix. */ |
| 581 | int nrows, ncolumns; | 581 | int nrows, ncolumns; |