Skip to content

Commit

Permalink
Prevent crash on missing eContent
Browse files Browse the repository at this point in the history
Applies to the RouteOriginAttestation and Manifest octet strings.

Thanks to Niklas Vogel for reporting this.
  • Loading branch information
ydahhrk committed Aug 6, 2024
1 parent 4dafbd9 commit 942f921
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/asn1/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ int
asn1_decode_any(ANY_t *any, asn_TYPE_descriptor_t const *descriptor,
void **result, bool log)
{
return asn1_decode(any->buf, any->size, descriptor, result, log);
return (any != NULL)
? asn1_decode(any->buf, any->size, descriptor, result, log)
: pr_val_err("ANY '%s' is NULL.", descriptor->name);
}

int
asn1_decode_octet_string(OCTET_STRING_t *string,
asn_TYPE_descriptor_t const *descriptor, void **result, bool log)
{
return asn1_decode(string->buf, string->size, descriptor, result, log);
return (string != NULL)
? asn1_decode(string->buf, string->size, descriptor, result, log)
: pr_val_err("Octet String '%s' is NULL.", descriptor->name);
}

/*
Expand Down

0 comments on commit 942f921

Please sign in to comment.