From f64cd71d442b0b7152131282dd7567be010edb78 Mon Sep 17 00:00:00 2001 From: dana Date: Mon, 24 Dec 2018 02:42:18 -0600 Subject: 43935: Reject too-large nanosecond values given to strftime ... and, in so doing, fix an error in the tests on 32-bit machines. The value for the new too-large test is changed slightly from the patch posted to the ML to make it test for the right thing on 32-bit machines as well. --- Src/Modules/datetime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Src/Modules') diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c index 18c7fb58e..521c15a5b 100644 --- a/Src/Modules/datetime.c +++ b/Src/Modules/datetime.c @@ -148,7 +148,7 @@ output_strftime(char *nam, char **argv, Options ops, UNUSED(int func)) } else if (*argv[2] == '\0' || *endptr != '\0') { zwarnnam(nam, "%s: invalid decimal number", argv[2]); return 1; - } else if (ts.tv_nsec < 0) { + } else if (ts.tv_nsec < 0 || ts.tv_nsec > 999999999) { zwarnnam(nam, "%s: invalid nanosecond value", argv[2]); return 1; } -- cgit 1.4.1