diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-04-20 17:09:03 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-04-20 17:10:55 +0200 |
commit | 8b10c845f9ec5730df45c53deb74b1ba187fabd4 (patch) | |
tree | 7455fa6462b53efb99cfc95a98f52780d4e06aa8 | |
parent | 22787a738c69322cc4b1b6fbabd7b4ee7db61857 (diff) | |
download | libtasn1-8b10c845f9ec5730df45c53deb74b1ba187fabd4.tar.gz |
decoding: added null pointer check
-rw-r--r-- | lib/decoding.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/decoding.c b/lib/decoding.c index e5513a3..ef26f6d 100644 --- a/lib/decoding.c +++ b/lib/decoding.c @@ -1361,7 +1361,15 @@ asn1_der_decoding2 (asn1_node *element, const void *ider, int *max_ider_len, { /* indefinite length method */ p->tmp_ival = -1; } + p2 = p->down; + if (p2 == NULL) + { + result = ASN1_DER_ERROR; + warn(); + goto cleanup; + } + while ((type_field (p2->type) == ASN1_ETYPE_TAG) || (type_field (p2->type) == ASN1_ETYPE_SIZE)) p2 = p2->right; |