From ae58ff1fbc37d8ace14dae8cc15859add5edac7f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 29 Aug 2011 13:03:30 -0700 Subject: [PATCH] * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer. --- src/ChangeLog | 2 ++ src/xterm.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.39.2