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:
David Garske
2016-02-25 14:35:54 +01:00
parent 1227db4e44
commit a46fd6612b

View File

@@ -4469,10 +4469,12 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert)
}
/* store cert for potential retrieval */
ret = AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL);
if (ret == 0) {
if (AllocDer(&x509->derCert, dCert->maxIdx, CERT_TYPE, NULL) == 0) {
XMEMCPY(x509->derCert.buffer, dCert->source, dCert->maxIdx);
}
else {
ret = MEMORY_E;
}
x509->altNames = dCert->altNames;
dCert->weOwnAltNames = 0;