mirror of
https://github.com/curl/curl.git
synced 2026-08-24 12:33:37 +03:00
http: add asserts for null terminator for input strings
http_rw_hd() assumes the null terminator is present. These asserts make sure this remains true. Closes #19741
This commit is contained in:
parent
48939a4575
commit
bfc3d131b6
2 changed files with 3 additions and 0 deletions
|
|
@ -4142,6 +4142,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data,
|
|||
CURLcode result = CURLE_OK;
|
||||
struct SingleRequest *k = &data->req;
|
||||
int writetype;
|
||||
DEBUGASSERT(!hd[hdlen]); /* null terminated */
|
||||
|
||||
*pconsumed = 0;
|
||||
if((0x0a == *hd) || (0x0d == *hd)) {
|
||||
|
|
@ -4426,6 +4427,7 @@ CURLcode Curl_http_write_resp_hd(struct Curl_easy *data,
|
|||
CURLcode result;
|
||||
size_t consumed;
|
||||
char tmp = 0;
|
||||
DEBUGASSERT(!hd[hdlen]); /* null terminated */
|
||||
|
||||
result = http_rw_hd(data, hd, hdlen, &tmp, 0, &consumed);
|
||||
if(!result && is_eos) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue