From: Paul Eggert Date: Mon, 29 Aug 2011 20:03:30 +0000 (-0700) Subject: * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer. X-Git-Tag: emacs-pretest-24.0.90~104^2~153^2~1^2~15 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ae58ff1fbc37d8ace14dae8cc15859add5edac7f;p=emacs.git * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer. --- diff --git a/src/ChangeLog b/src/ChangeLog index 53344aa7dd9..38779ef8598 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -97,6 +97,8 @@ * xfns.c (x_window): Make sprintf buffer a bit bigger to avoid potential buffer overrun. + * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer. + 2011-08-26 Paul Eggert Integer and memory overflow issues (Bug#9196). diff --git a/src/xterm.c b/src/xterm.c index c07caec6c78..86393cf411f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7900,7 +7900,8 @@ x_io_error_quitter (Display *display) { char buf[256]; - sprintf (buf, "Connection lost to X server `%s'", DisplayString (display)); + snprintf (buf, sizeof buf, "Connection lost to X server `%s'", + DisplayString (display)); x_connection_closed (display, buf); return 0; }