Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140043897
D11660.id30966.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
822 B
Referenced Files
None
Subscribers
None
D11660.id30966.diff
View Options
Index: bin/date/date.c
===================================================================
--- bin/date/date.c
+++ bin/date/date.c
@@ -85,7 +85,7 @@
int set_timezone;
struct vary *v;
const struct vary *badv;
- struct tm lt;
+ struct tm *lt;
struct stat sb;
v = NULL;
@@ -174,8 +174,10 @@
if (*argv && **argv == '+')
format = *argv + 1;
- lt = *localtime(&tval);
- badv = vary_apply(v, <);
+ lt = localtime(&tval);
+ if (lt == NULL)
+ errx(1, "invalid time");
+ badv = vary_apply(v, lt);
if (badv) {
fprintf(stderr, "%s: Cannot apply date adjustment\n",
badv->arg);
@@ -191,7 +193,7 @@
*/
setlocale(LC_TIME, "C");
- (void)strftime(buf, sizeof(buf), format, <);
+ (void)strftime(buf, sizeof(buf), format, lt);
(void)printf("%s\n", buf);
if (fflush(stdout))
err(1, "stdout");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 20, 11:19 AM (14 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27096194
Default Alt Text
D11660.id30966.diff (822 B)
Attached To
Mode
D11660: date: avoid crash on invalid time
Attached
Detach File
Event Timeline
Log In to Comment