mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-11 15:10:50 +02:00
Fix from review
This commit is contained in:
+9
-6
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user