Skip to content

Commit

Permalink
Work around Coverity CID 402852, follow-up to ec059ec
Browse files Browse the repository at this point in the history
This is a workaround to a CWE-569 class warning from Coverity Scan.  In
my opinion it's bogus, so that's why we should silence it.

Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Nov 12, 2022
1 parent d5dcdd3 commit 5abff22
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/freedns.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static char *fetch_keys(ddns_t *ctx, ddns_info_t *info)
http_trans_t trans;
http_t client;
char buffer[384];
int i, rc;
int i, rc, level;

rc = (http_construct(&client));
if (rc)
Expand Down Expand Up @@ -88,7 +88,11 @@ static char *fetch_keys(ddns_t *ctx, ddns_info_t *info)
trans.max_rsp_len = ctx->work_buflen - 1; /* Save place for a \0 at the end */

rc = http_transaction(&client, &trans);
logit((strstr(trans.rsp_body, "ERROR:") ? LOG_ERR : LOG_DEBUG), "=> %s", trans.rsp_body);
if (strstr(trans.rsp_body, "ERROR:"))
level = LOG_ERR;
else
level = LOG_DEBUG;
logit(level, "=> %s", trans.rsp_body);
http_exit(&client);
http_destruct(&client, 1);

Expand Down

0 comments on commit 5abff22

Please sign in to comment.