mirror of
https://github.com/curl/curl.git
synced 2026-08-25 06:03:32 +03:00
quiche: reject headers in the wrong order
Pseudo header MUST come before regular headers or cause an error. Reported-by: Cynthia Coan Fixes #4571 Closes #4584
This commit is contained in:
parent
8686aab694
commit
b3eb7d172a
5 changed files with 14 additions and 4 deletions
|
|
@ -314,8 +314,10 @@ curl_easy_strerror(CURLcode error)
|
|||
case CURLE_AUTH_ERROR:
|
||||
return "An authentication function returned an error";
|
||||
|
||||
case CURLE_HTTP3:
|
||||
return "HTTP/3 error";
|
||||
|
||||
/* error codes not used by current libcurl */
|
||||
case CURLE_OBSOLETE20:
|
||||
case CURLE_OBSOLETE24:
|
||||
case CURLE_OBSOLETE29:
|
||||
case CURLE_OBSOLETE32:
|
||||
|
|
|
|||
|
|
@ -379,6 +379,9 @@ static int cb_each_header(uint8_t *name, size_t name_len,
|
|||
headers->destlen, "HTTP/3 %.*s\n",
|
||||
(int) value_len, value);
|
||||
}
|
||||
else if(!headers->nlen) {
|
||||
return CURLE_HTTP3;
|
||||
}
|
||||
else {
|
||||
msnprintf(headers->dest,
|
||||
headers->destlen, "%.*s: %.*s\n",
|
||||
|
|
@ -433,7 +436,9 @@ static ssize_t h3_stream_recv(struct connectdata *conn,
|
|||
case QUICHE_H3_EVENT_HEADERS:
|
||||
rc = quiche_h3_event_for_each_header(ev, cb_each_header, &headers);
|
||||
if(rc) {
|
||||
/* what do we do about this? */
|
||||
*curlcode = rc;
|
||||
failf(data, "Error in HTTP/3 response header");
|
||||
break;
|
||||
}
|
||||
recvd = headers.nlen;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue