mirror of
https://github.com/curl/curl.git
synced 2026-08-24 21:43:32 +03:00
Replaced all uses of sprintf() with the safer snprintf(). It is just a
precaution to prevent mistakes to lead to buffer overflows.
This commit is contained in:
parent
5e34f3dc01
commit
feb2dd2835
13 changed files with 490 additions and 486 deletions
|
|
@ -300,13 +300,14 @@ CURLcode Curl_file(struct connectdata *conn)
|
|||
date. */
|
||||
if(conn->bits.no_body && data->set.include_header && fstated) {
|
||||
CURLcode result;
|
||||
sprintf(buf, "Content-Length: %" FORMAT_OFF_T "\r\n", expected_size);
|
||||
snprintf(buf, sizeof(data->state.buffer),
|
||||
"Content-Length: %" FORMAT_OFF_T "\r\n", expected_size);
|
||||
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
sprintf(buf, "Accept-ranges: bytes\r\n");
|
||||
result = Curl_client_write(data, CLIENTWRITE_BOTH, buf, 0);
|
||||
result = Curl_client_write(data, CLIENTWRITE_BOTH,
|
||||
"Accept-ranges: bytes\r\n", 0);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue