From: Alberto Leiva Popper Date: Tue, 6 Aug 2024 16:35:24 +0000 (-0600) Subject: Prevent crash on missing eContent X-Git-Tag: 1.6.3~4 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=942f921ba7244cdcf4574cedc4c16392a7cc594b;p=thirdparty%2FFORT-validator.git Prevent crash on missing eContent Applies to the RouteOriginAttestation and Manifest octet strings. Thanks to Niklas Vogel for reporting this. --- diff --git a/src/asn1/decode.c b/src/asn1/decode.c index 1de93080..66862451 100644 --- a/src/asn1/decode.c +++ b/src/asn1/decode.c @@ -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); } /*