http: fix off-by-one error in request method length check
It should allow one more byte. Closes #12534
This commit is contained in:
parent
102de7aa8d
commit
1e9db6997a
@ -4609,7 +4609,7 @@ CURLcode Curl_http_req_make(struct httpreq **preq,
|
||||
CURLcode result = CURLE_OUT_OF_MEMORY;
|
||||
|
||||
DEBUGASSERT(method);
|
||||
if(m_len + 1 >= sizeof(req->method))
|
||||
if(m_len + 1 > sizeof(req->method))
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
|
||||
req = calloc(1, sizeof(*req));
|
||||
@ -4765,7 +4765,7 @@ CURLcode Curl_http_req_make2(struct httpreq **preq,
|
||||
CURLUcode uc;
|
||||
|
||||
DEBUGASSERT(method);
|
||||
if(m_len + 1 >= sizeof(req->method))
|
||||
if(m_len + 1 > sizeof(req->method))
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
|
||||
req = calloc(1, sizeof(*req));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user