From 5ebd7bc62bb8a86507b46717c2d3f05a4281b24c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Francesco=20Potort=C3=AC?= Date: Wed, 5 Jun 2002 11:54:50 +0000 Subject: [PATCH] (main): Avoid a buffer overrun with sprintf. --- lib-src/etags.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.2