mirror of
https://github.com/curl/curl.git
synced 2026-07-15 20:17:20 +03:00
tool_writeout: check gmtime return code too
If the unlikely event happen that it fails, it returns NULL. CodeSonar is not happy unless we check for it. Closes #18225
This commit is contained in:
parent
673b6c8cb8
commit
065a653158
1 changed files with 1 additions and 1 deletions
|
|
@ -603,7 +603,7 @@ static const char *outtime(const char *ptr, /* %time{ ... */
|
|||
if(!result) {
|
||||
/* !checksrc! disable BANNEDFUNC 1 */
|
||||
utc = gmtime(&secs);
|
||||
if(curlx_dyn_len(&format) &&
|
||||
if(curlx_dyn_len(&format) && utc &&
|
||||
strftime(output, sizeof(output), curlx_dyn_ptr(&format), utc))
|
||||
fputs(output, stream);
|
||||
curlx_dyn_free(&format);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue