From: Juanma Barranquero Date: Sat, 8 Jun 2019 07:02:45 +0000 (+0200) Subject: * nt/addpm.c (main): Fix buffer overflow X-Git-Tag: emacs-26.2.90~15 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=25d44d27dad78d55adfd5905bb9344a8521a18dd;p=emacs.git * nt/addpm.c (main): Fix buffer overflow --- diff --git a/nt/addpm.c b/nt/addpm.c index f71ce5f2385..a8bcd4a5c73 100644 --- a/nt/addpm.c +++ b/nt/addpm.c @@ -219,8 +219,9 @@ main (int argc, char *argv[]) { int result; - char msg[ MAX_PATH ]; - sprintf (msg, "Install Emacs at %s?\n", emacs_path); + const char install_msg[] = "Install Emacs at %s?\n"; + char msg[ MAX_PATH + sizeof (install_msg) ]; + sprintf (msg, install_msg, emacs_path); result = MessageBox (NULL, msg, "Install Emacs", MB_OKCANCEL | MB_ICONQUESTION); if (result != IDOK)