forked from wolfSSL/wolfssl
Changed CopyDecodedToX509 AllocDer error code handing to return MEMORY_E, since that is an explicitly handled case. Also resolves the issue with "warning: Value stored to 'ret' is never read".
This commit is contained in:
@@ -4469,10 +4469,12 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* store cert for potential retrieval */
|
/* store cert for potential retrieval */
|
||||||
ret = AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL);
|
if (AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL) == 0) {
|
||||||
if (ret == 0) {
|
|
||||||
XMEMCPY(x509->derCert.buffer, dCert->source, dCert->maxIdx);
|
XMEMCPY(x509->derCert.buffer, dCert->source, dCert->maxIdx);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
ret = MEMORY_E;
|
||||||
|
}
|
||||||
|
|
||||||
x509->altNames = dCert->altNames;
|
x509->altNames = dCert->altNames;
|
||||||
dCert->weOwnAltNames = 0;
|
dCert->weOwnAltNames = 0;
|
||||||
|
Reference in New Issue
Block a user