Module Name: src Committed By: christos Date: Sun Dec 15 06:41:18 UTC 2013
Modified Files: src/external/historical/nawk/dist: run.c Log Message: PR/48448: David A. Holland: Avoid coredump by checking return code of localtime(3) To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/historical/nawk/dist/run.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/historical/nawk/dist/run.c diff -u src/external/historical/nawk/dist/run.c:1.7 src/external/historical/nawk/dist/run.c:1.8 --- src/external/historical/nawk/dist/run.c:1.7 Sun Oct 27 06:06:01 2013 +++ src/external/historical/nawk/dist/run.c Sun Dec 15 01:41:18 2013 @@ -1647,6 +1647,8 @@ Cell *bltin(Node **a, int n) /* builtin } else tv = time((time_t *) 0); tm = localtime(&tv); + if (tm == NULL) + FATAL("bad time %jd", (intmax_t)tv); if (isrec(x)) { /* format argument not provided, use default */