aboutsummaryrefslogtreecommitdiffstats
path: root/epan/asn1.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-09-20 17:24:23 +0000
committerGerald Combs <gerald@wireshark.org>2005-09-20 17:24:23 +0000
commit5cb2a5e1628ab28e4dbb56f6b834c858ee736b98 (patch)
tree80238ce0c4161cfa70dc3f1e408bfb75e38065dc /epan/asn1.c
parentba83bf145fc57c59b16d67ca78a97e8e6716d193 (diff)
Fix a couple of errors found by valgrind.
svn path=/trunk/; revision=15900
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;