]> git.eshelyaron.com Git - emacs.git/commitdiff
(main): Avoid a buffer overrun with sprintf.
authorFrancesco Potortì <pot@gnu.org>
Wed, 5 Jun 2002 11:54:50 +0000 (11:54 +0000)
committerFrancesco Potortì <pot@gnu.org>
Wed, 5 Jun 2002 11:54:50 +0000 (11:54 +0000)
lib-src/etags.c

index bf932a90a8b6d59d6061fd018f4802ed89775b9c..2b044dffed25dde7c7517a59af786d4d67c4e0ed 100644 (file)
@@ -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;