forked from wolfSSL/wolfssl
Catch allocation failure in DecodeResponseData
This commit is contained in:
@@ -17472,12 +17472,20 @@ static int DecodeResponseData(byte* source,
|
|||||||
if (single->next == NULL) {
|
if (single->next == NULL) {
|
||||||
return MEMORY_E;
|
return MEMORY_E;
|
||||||
}
|
}
|
||||||
single = single->next;
|
XMEMSET(single->next, 0, sizeof(OcspEntry));
|
||||||
XMEMSET(single, 0, sizeof(OcspEntry));
|
|
||||||
single->status = (CertStatus*)XMALLOC(sizeof(CertStatus),
|
single->next->status = (CertStatus*)XMALLOC(sizeof(CertStatus),
|
||||||
resp->heap, DYNAMIC_TYPE_OCSP_STATUS);
|
resp->heap, DYNAMIC_TYPE_OCSP_STATUS);
|
||||||
XMEMSET(single->status, 0, sizeof(CertStatus));
|
if ( single->next->status == NULL ) {
|
||||||
single->isDynamic = 1;
|
XFREE(single->next, resp->heap, DYNAMIC_TYPE_OCSP_ENTRY);
|
||||||
|
single->next = NULL;
|
||||||
|
return MEMORY_E;
|
||||||
|
}
|
||||||
|
XMEMSET(single->next->status, 0, sizeof(CertStatus));
|
||||||
|
|
||||||
|
single->next->isDynamic = 1;
|
||||||
|
|
||||||
|
single = single->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user