Skip to content

Commit 213c43b

Browse files
authored
Merge pull request #8715 from padelsbach/ssl-certman-codesonar
Speculative fix for CodeSonar overflow issue in ssl_certman.c
2 parents 1ee954a + b4d9442 commit 213c43b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ssl_certman.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ int CM_MemRestoreCertCache(WOLFSSL_CERT_MANAGER* cm, const void* mem, int sz)
15251525
WOLFSSL_ENTER("CM_MemRestoreCertCache");
15261526

15271527
/* Check memory available is bigger than cache header. */
1528-
if (current > end) {
1528+
if ((sz < (int)sizeof(CertCacheHeader)) || (current > end)) {
15291529
WOLFSSL_MSG("Cert Cache Memory buffer too small");
15301530
ret = BUFFER_E;
15311531
}

0 commit comments

Comments
 (0)