mirror of
https://github.com/curl/curl.git
synced 2026-08-01 10:38:04 +03:00
curl: tool_read_cb fix of segfault
When transfers read client input without an upload file, the check if upload file is '.' strcompared a NULL. Add test 1548 to reproduce and verify fix. Reported-by: d1r3ct0r Fixes #17978 Closes #17987
This commit is contained in:
parent
c221c0ee59
commit
9657a2041e
3 changed files with 45 additions and 2 deletions
|
|
@ -90,7 +90,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
|
|||
Make sure we are in non-blocking mode and infd is not regular stdin
|
||||
On Linux per->infd should be stdin (0) and the block below should not
|
||||
execute */
|
||||
if(!strcmp(per->uploadfile, ".") && per->infd > 0) {
|
||||
if(per->uploadfile && !strcmp(per->uploadfile, ".") && per->infd > 0) {
|
||||
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP) && !defined(UNDER_CE)
|
||||
rc = recv(per->infd, buffer, curlx_uztosi(sz * nmemb), 0);
|
||||
if(rc < 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue