Fix from review

This commit is contained in:
Eric Blankenhorn
2026-02-24 11:17:42 -06:00
parent 2ae3164c6f
commit 8f787909da
+9 -6
View File
@@ -4835,14 +4835,17 @@ static int wolfssl_add_to_chain(DerBuffer** chain, int weOwn, const byte* cert,
if ((len > WOLFSSL_MAX_32BIT - CERT_HEADER_SZ) ||
(certSz > WOLFSSL_MAX_32BIT - CERT_HEADER_SZ - len)) {
WOLFSSL_MSG("wolfssl_add_to_chain overflow");
return 0;
}
/* Allocate DER buffer big enough to hold old and new certificates. */
ret = AllocDer(&newChain, len + CERT_HEADER_SZ + certSz, CERT_TYPE, heap);
if (ret != 0) {
WOLFSSL_MSG("AllocDer error");
res = 0;
}
if (res == 1) {
/* Allocate DER buffer big enough to hold old and new certificates. */
ret = AllocDer(&newChain, len + CERT_HEADER_SZ + certSz, CERT_TYPE,
heap);
if (ret != 0) {
WOLFSSL_MSG("AllocDer error");
res = 0;
}
}
if (res == 1) {
if (oldChain != NULL) {