Skip to content

Commit

Permalink
Merge pull request #7536 from gasbytes/buffer_overflows_fix
Browse files Browse the repository at this point in the history
added check that checks if the SEQ's length is > than the buff's length
  • Loading branch information
dgarske committed May 15, 2024
2 parents ac7aea9 + 2f24b35 commit fd4db14
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ssl_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ static int DataToDerBuffer(const unsigned char* buff, word32 len, int format,
else {
ret = ASN_PARSE_E;
}

if (info->consumed > (int)len) {
ret = ASN_PARSE_E;
}
if (ret == 0) {
ret = AllocCopyDer(der, buff, (word32)info->consumed, type, heap);
}
Expand Down

0 comments on commit fd4db14

Please sign in to comment.