From: Francesco Potortì Date: Wed, 5 Jun 2002 11:54:50 +0000 (+0000) Subject: (main): Avoid a buffer overrun with sprintf. X-Git-Tag: emacs-pretest-21.2.91~239 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5ebd7bc62bb8a86507b46717c2d3f05a4281b24c;p=emacs.git (main): Avoid a buffer overrun with sprintf. --- diff --git a/lib-src/etags.c b/lib-src/etags.c index bf932a90a8b..2b044dffed2 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -1219,8 +1219,8 @@ main (argc, argv) if (update) { - char cmd[BUFSIZ]; - sprintf (cmd, "sort -o %s %s", tagfile, tagfile); + char cmd[2*BUFSIZ+10]; + sprintf (cmd, "sort -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile); exit (system (cmd)); } return GOOD;