mirror of
https://github.com/curl/curl.git
synced 2026-04-14 21:31:42 +03:00
strerr: correct the strerror_s() return code condition
In curlx_strerror on Windows, the condition checks `!strerror_s(...)`
(true on success) and therefore always evaluates the fallback block.
Even when strerror_s successfully produced a valid errno message.
Follow-up to 1eca08a541
Pointed out by Codex Security
Closes #20955
This commit is contained in:
parent
38107d3354
commit
e894699c1e
1 changed files with 1 additions and 1 deletions
|
|
@ -263,7 +263,7 @@ const char *curlx_strerror(int err, char *buf, size_t buflen)
|
|||
*buf = '\0';
|
||||
|
||||
#ifdef _WIN32
|
||||
if((!strerror_s(buf, buflen, err) || !strcmp(buf, "Unknown error")) &&
|
||||
if((strerror_s(buf, buflen, err) || !strcmp(buf, "Unknown error")) &&
|
||||
#ifdef USE_WINSOCK
|
||||
!get_winsock_error(err, buf, buflen) &&
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue