Skip to content

Commit

Permalink
account for negative return value, fixes coverity issue 394678
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Jul 5, 2024
1 parent de20bb7 commit b948f67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ssl_asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ static int wolfssl_i2d_asn1_item(void** item, int type, byte* buf)
len = 0;
}

if (len < 0) {
len = 0; /* wolfSSL_i2d_ASN1_INTEGER can return a value less than 0
* on error */
}

return len;
}

Expand Down

0 comments on commit b948f67

Please sign in to comment.