Skip to content

Commit 1c91f7e

Browse files
committed
Speculative fix for CodeSonar overflow issue
1 parent b077c81 commit 1c91f7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ssl_certman.c

+1-1
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 < sizeof(CertCacheHeader)) || (current > end)) {
15291529
WOLFSSL_MSG("Cert Cache Memory buffer too small");
15301530
ret = BUFFER_E;
15311531
}

0 commit comments

Comments
 (0)