mirror of
https://github.com/curl/curl.git
synced 2025-04-24 16:40:32 +08:00
getdate: return -1 for 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 Closes #2278
This commit is contained in:
parent
1eb4f5ac9d
commit
a19afaccfe
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user