Skip to content

Commit 5d54d8a

Browse files
committed
init caCert before function can error out
1 parent 0792c67 commit 5d54d8a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

examples/ocsp_responder/ocsp_responder.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,9 @@ THREAD_RETURN WOLFSSL_THREAD ocsp_responder_test(void* args)
749749
opts.sendCerts = 1;
750750
opts.readyFile = NULL;
751751

752+
/* Initialize caCert */
753+
XMEMSET(&caCert, 0, sizeof(caCert));
754+
752755
/* Parse command line arguments */
753756
while ((ch = mygetopt_long(argc, argv, "?p:c:r:k:i:R:n:vx",
754757
long_options, 0)) != -1) {
@@ -848,7 +851,6 @@ THREAD_RETURN WOLFSSL_THREAD ocsp_responder_test(void* args)
848851
}
849852

850853
/* Parse CA certificate to get subject */
851-
XMEMSET(&caCert, 0, sizeof(caCert));
852854
wc_InitDecodedCert(&caCert, caCertDer, caCertDerSz, NULL);
853855
ret = wc_ParseCert(&caCert, CERT_TYPE, 0, NULL);
854856
if (ret != 0) {

0 commit comments

Comments
 (0)