projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0bc2181
)
parse_header_time(): Explicitly check for strftime() failures when sanity-checking...
author
Fabian Keil
<fk@fabiankeil.de>
Sat, 30 Apr 2016 10:28:36 +0000
(10:28 +0000)
committer
Fabian Keil
<fk@fabiankeil.de>
Sat, 30 Apr 2016 10:28:36 +0000
(10:28 +0000)
parsers.c
patch
|
blob
|
history
diff --git
a/parsers.c
b/parsers.c
index
64e6985
..
8e0ea45
100644
(file)
--- a/
parsers.c
+++ b/
parsers.c
@@
-1,4
+1,4
@@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.30
7 2016/01/17 14:31:47
fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.30
8 2016/02/26 12:31:12
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@
-4313,7
+4313,13
@@
static jb_err parse_header_time(const char *header_time, time_t *result)
time_t result2;
tm = gmtime(result);
time_t result2;
tm = gmtime(result);
- strftime(recreated_date, sizeof(recreated_date), time_formats[i], tm);
+ if (!strftime(recreated_date, sizeof(recreated_date),
+ time_formats[i], tm))
+ {
+ log_error(LOG_LEVEL_ERROR, "Failed to recreate date '%s' with '%s'.",
+ header_time, time_formats[i]);
+ continue;
+ }
memset(&gmt, 0, sizeof(gmt));
if (NULL == strptime(recreated_date, time_formats[i], &gmt))
{
memset(&gmt, 0, sizeof(gmt));
if (NULL == strptime(recreated_date, time_formats[i], &gmt))
{