]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
dumpscan: appease gcc8 -Wformat-overflow
authorBenjamin Kaduk <kaduk@mit.edu>
Sat, 2 Feb 2019 23:10:29 +0000 (17:10 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Sat, 25 Jan 2020 20:41:06 +0000 (15:41 -0500)
gcc does not benefit from our external knowledge that tm_year is
tightly bounded, and thinks it could still be in the range
[-21474817482147483647], which would overflow our string buffer.
The function in question does not have error handling in place, so
rather than adding some or trying to assert the proper bounds, just
use a slightly larger buffer for safety.

Reviewed-on: https://gerrit.openafs.org/13472
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8f03ff3bdd8eb9f4557cdb7054aee9b8ea432160)

Change-Id: I05c8d998c6d40118a1bde923e346cddbdfa4192b
Reviewed-on: https://gerrit.openafs.org/13741
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/tools/dumpscan/afsdump_extract.c

index 98f3a0c27168193e66f8484c388a009c4c08e605..db0b2fab9571ba8efa3e1866de3d5427662e8d07 100644 (file)
@@ -237,7 +237,7 @@ static char *month[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
 static char *
 datestr(time_t date)
 {
-    static char str[13];
+    static char str[20];
     time_t clock = time(0);
     struct tm *now, *then;
     int diff;