projects
/
privoxy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fdf66c5
)
Check for strftime() failures in server_last_modified(), too.
author
Fabian Keil
<fk@fabiankeil.de>
Wed, 17 Jun 2009 14:51:23 +0000
(14:51 +0000)
committer
Fabian Keil
<fk@fabiankeil.de>
Wed, 17 Jun 2009 14:51:23 +0000
(14:51 +0000)
parsers.c
patch
|
blob
|
history
diff --git
a/parsers.c
b/parsers.c
index
2e7822d
..
d937211
100644
(file)
--- a/
parsers.c
+++ b/
parsers.c
@@
-1,4
+1,4
@@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.1
79 2009/06/16 15:42:28
fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.1
80 2009/06/17 14:50:55
fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@
-2334,7
+2334,15
@@
static jb_err server_last_modified(struct client_state *csp, char **header)
#else
timeptr = gmtime(&last_modified);
#endif
#else
timeptr = gmtime(&last_modified);
#endif
- strftime(newheader, sizeof(newheader), "%a, %d %b %Y %H:%M:%S GMT", timeptr);
+ if (!strftime(newheader, sizeof(newheader),
+ "%a, %d %b %Y %H:%M:%S GMT", timeptr))
+ {
+ log_error(LOG_LEVEL_ERROR,
+ "Randomizing %s failed. Keeping the header unmodified.",
+ *header);
+ return JB_ERR_OK;
+ }
+
freez(*header);
*header = strdup("Last-Modified: ");
string_append(header, newheader);
freez(*header);
*header = strdup("Last-Modified: ");
string_append(header, newheader);