mirror of
https://github.com/curl/curl.git
synced 2026-05-16 08:06:22 +03:00
tool_cb_hdr: size is always 1
- add comment in the header that the argument 'size' is always 1, as guaranteed by the libcurl API - then fix the call to fwrite() to avoid using "size, etag_length" which would be wrong if size was something else than 1, and use a fixed number there instead. Reported in Joshua's sarif data Closes #18630
This commit is contained in:
parent
335d16e944
commit
0209e087c6
1 changed files with 3 additions and 1 deletions
|
|
@ -81,6 +81,8 @@ fail:
|
|||
|
||||
/*
|
||||
** callback for CURLOPT_HEADERFUNCTION
|
||||
*
|
||||
* 'size' is always 1
|
||||
*/
|
||||
size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
||||
{
|
||||
|
|
@ -164,7 +166,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
|||
}
|
||||
#endif
|
||||
|
||||
fwrite(etag_h, size, etag_length, etag_save->stream);
|
||||
fwrite(etag_h, 1, etag_length, etag_save->stream);
|
||||
/* terminate with newline */
|
||||
fputc('\n', etag_save->stream);
|
||||
(void)fflush(etag_save->stream);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue