heimdal/asn1: do not throw error when trying to allocate 0 bytes of memory
This commit is contained in:

committed by
Nico Williams

parent
6dc36f99c0
commit
14aca7a831
@@ -3015,7 +3015,7 @@ _asn1_copy(const struct asn1_template *t, const void *from, void *to)
|
||||
unsigned int i;
|
||||
|
||||
tel->val = calloc(fel->len, ellen);
|
||||
if (tel->val == NULL)
|
||||
if (tel->val == NULL && fel->len > 0)
|
||||
return ENOMEM;
|
||||
|
||||
tel->len = fel->len;
|
||||
|
Reference in New Issue
Block a user