Skip to content

Commit b948f67

Browse files
account for negative return value, fixes coverity issue 394678
1 parent de20bb7 commit b948f67

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/ssl_asn1.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ static int wolfssl_i2d_asn1_item(void** item, int type, byte* buf)
247247
len = 0;
248248
}
249249

250+
if (len < 0) {
251+
len = 0; /* wolfSSL_i2d_ASN1_INTEGER can return a value less than 0
252+
* on error */
253+
}
254+
250255
return len;
251256
}
252257

0 commit comments

Comments
 (0)