Skip to content

Commit f436fb8

Browse files
authored
Merge pull request #10437 from gasbytes/CertManagerLoadCABufferType_MoveXMemset
zero-initialize DecodedCert immediately after allocation in wolfSSL_CertManagerCABufferType
2 parents 2c4f854 + 54bb2c2 commit f436fb8

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
@@ -633,6 +633,7 @@ int wolfSSL_CertManagerLoadCABufferType(WOLFSSL_CERT_MANAGER* cm,
633633
if (dCert == NULL) {
634634
ret = WOLFSSL_FATAL_ERROR;
635635
} else {
636+
XMEMSET(dCert, 0, sizeof(DecodedCert));
636637
if (format == WOLFSSL_FILETYPE_PEM) {
637638
#ifndef WOLFSSL_PEM_TO_DER
638639
ret = NOT_COMPILED_IN;
@@ -651,7 +652,6 @@ int wolfSSL_CertManagerLoadCABufferType(WOLFSSL_CERT_MANAGER* cm,
651652
}
652653

653654
if (ret == WOLFSSL_SUCCESS) {
654-
XMEMSET(dCert, 0, sizeof(DecodedCert));
655655
wc_InitDecodedCert(dCert, buff,
656656
(word32)sz, cm->heap);
657657
ret = wc_ParseCert(dCert, CERT_TYPE, NO_VERIFY, NULL);

0 commit comments

Comments
 (0)