From: Paul Eggert Date: Mon, 29 Aug 2011 19:47:44 +0000 (-0700) Subject: * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger X-Git-Tag: emacs-pretest-24.0.90~104^2~153^2~1^2~18 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=80f2e268a31679c363e0fa2c660d8dca53871aed;p=emacs.git * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger to avoid potential buffer overrun. --- diff --git a/src/ChangeLog b/src/ChangeLog index b1c29363da0..97d1ea08db1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -88,6 +88,9 @@ * process.c (make_process): Use printmax_t, not int, to format process-name gensyms. + * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger + to avoid potential buffer overrun. + 2011-08-26 Paul Eggert 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) { int face_id; int len; - char buf[9]; + char buf[sizeof "\\x" + max (6, (sizeof it->c * CHAR_BIT + 3) / 4)]; char const *str = " "; /* Get a face ID for the glyph by utilizing a cache (the same way as