aboutsummaryrefslogtreecommitdiffstats
path: root/epan/asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/asn1.c')
-rw-r--r--epan/asn1.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/asn1.c b/epan/asn1.c
index 5d118479aa..299ab537b7 100644
--- a/epan/asn1.c
+++ b/epan/asn1.c
@@ -896,8 +896,11 @@ asn1_oid_value_decode ( ASN1_SCK *asn1, int enc_len, subid_t **oid, guint *len)
* but that's another matter; in any case, that would happen only
* if we had an immensely large tvbuff....)
*/
- if (enc_len != 0)
- tvb_ensure_bytes_exist(asn1->tvb, asn1->offset, enc_len);
+ if (enc_len < 1) {
+ *oid = NULL;
+ return ASN1_ERR_LENGTH_MISMATCH;
+ }
+ tvb_ensure_bytes_exist(asn1->tvb, asn1->offset, enc_len);
eoc = asn1->offset + enc_len;