summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-02-01 22:23:20 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-02-01 22:24:10 +0100
commita69b6b2fce359528c874c7274f7e090a012a8827 (patch)
tree047ea8326a842828f850367638ace51b025980b2
parent1eb4f5ac9d9b9a73e1dba890636b599037bd643d (diff)
downloadcurl-bagder/getdate-out-of-range.tar.gz
getdate: return -1 for out of rangebagder/getdate-out-of-range
...as that's how the function is documented to work. Reported-by: Michael Kaufmann Bug found in an autobuild with 32 bit time_t
-rw-r--r--lib/parsedate.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/parsedate.c b/lib/parsedate.c
index beaa1bbd5..23a787fc9 100644
--- a/lib/parsedate.c
+++ b/lib/parsedate.c
@@ -561,14 +561,10 @@ time_t curl_getdate(const char *p, const time_t *now)
int rc = parsedate(p, &parsed);
(void)now; /* legacy argument from the past that we ignore */
- switch(rc) {
- case PARSEDATE_OK:
+ if(rc == PARSEDATE_OK) {
if(parsed == -1)
/* avoid returning -1 for a working scenario */
parsed++;
- /* fallthrough */
- case PARSEDATE_LATER:
- case PARSEDATE_SOONER:
return parsed;
}
/* everything else is fail */