diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/asn1.c | 7 | ||||
-rw-r--r-- | epan/dtd_parse.l | 3 |
2 files changed, 7 insertions, 3 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; diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l index 38a905b4ef..c0b1abfae0 100644 --- a/epan/dtd_parse.l +++ b/epan/dtd_parse.l @@ -82,7 +82,8 @@ #define DTD_PARSE(token_type) \ { DEBUG_DTD_TOKEN; \ - build_data->location = location; \ + build_data->location = location; \ + location = NULL; \ DtdParse(pParser, (token_type), new_token(yytext), build_data); \ if(build_data->error->len > 0) yyterminate(); \ } |