diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/altsvc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/altsvc.c b/lib/altsvc.c index a961e5c05..64971a9f0 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -442,6 +442,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, char option[32]; unsigned long num; char *end_ptr; + bool quoted = FALSE; semip++; /* pass the semicolon */ result = getalnum(&semip, option, sizeof(option)); if(result) @@ -451,12 +452,21 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data, if(*semip != '=') continue; semip++; + while(*semip && ISBLANK(*semip)) + semip++; + if(*semip == '\"') { + /* quoted value */ + semip++; + quoted = TRUE; + } num = strtoul(semip, &end_ptr, 10); - if(num < ULONG_MAX) { + if((end_ptr != semip) && num && (num < ULONG_MAX)) { if(strcasecompare("ma", option)) maxage = num; else if(strcasecompare("persist", option) && (num == 1)) persist = TRUE; + if(quoted && (*end_ptr == '\"')) + end_ptr++; } semip = end_ptr; } |