diff options
| author | Paul Eggert | 2011-08-29 12:47:44 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-08-29 12:47:44 -0700 |
| commit | 80f2e268a31679c363e0fa2c660d8dca53871aed (patch) | |
| tree | 48f9c5b4071a410ea3c799cd9e81f01fc7e1c415 | |
| parent | 31c286f79d43a002f441b90dc0176014ba0fa8e7 (diff) | |
| download | emacs-80f2e268a31679c363e0fa2c660d8dca53871aed.tar.gz emacs-80f2e268a31679c363e0fa2c660d8dca53871aed.zip | |
* term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
to avoid potential buffer overrun.
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/term.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b1c29363da0..97d1ea08db1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -88,6 +88,9 @@ | |||
| 88 | * process.c (make_process): Use printmax_t, not int, to format | 88 | * process.c (make_process): Use printmax_t, not int, to format |
| 89 | process-name gensyms. | 89 | process-name gensyms. |
| 90 | 90 | ||
| 91 | * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger | ||
| 92 | to avoid potential buffer overrun. | ||
| 93 | |||
| 91 | 2011-08-26 Paul Eggert <eggert@cs.ucla.edu> | 94 | 2011-08-26 Paul Eggert <eggert@cs.ucla.edu> |
| 92 | 95 | ||
| 93 | Integer and memory overflow issues (Bug#9196). | 96 | Integer and memory overflow issues (Bug#9196). |
diff --git a/src/term.c b/src/term.c index f3bf3a947cb..48d4069e20e 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -1887,7 +1887,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) | |||
| 1887 | { | 1887 | { |
| 1888 | int face_id; | 1888 | int face_id; |
| 1889 | int len; | 1889 | int len; |
| 1890 | char buf[9]; | 1890 | char buf[sizeof "\\x" + max (6, (sizeof it->c * CHAR_BIT + 3) / 4)]; |
| 1891 | char const *str = " "; | 1891 | char const *str = " "; |
| 1892 | 1892 | ||
| 1893 | /* Get a face ID for the glyph by utilizing a cache (the same way as | 1893 | /* Get a face ID for the glyph by utilizing a cache (the same way as |