From 1410207421f05ed65063c592d2ee30b71e69b4e6 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Tue, 10 Jul 2012 15:43:03 +0000 Subject: Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7438 : Do not call tvb_ensure_length_remaining on an empty tvb svn path=/trunk/; revision=43648 --- asn1/snmp/packet-snmp-template.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'asn1') diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c index 7af883917a..47343744b2 100644 --- a/asn1/snmp/packet-snmp-template.c +++ b/asn1/snmp/packet-snmp-template.c @@ -1218,9 +1218,10 @@ get_user_assoc(tvbuff_t* engine_tvb, tvbuff_t* user_tvb) if (! ( user_tvb && engine_tvb ) ) return NULL; - given_username_len = tvb_ensure_length_remaining(user_tvb,0); + given_username_len = tvb_length(user_tvb); + given_engine_len = tvb_length(engine_tvb); + if (! ( given_engine_len && given_username_len ) ) return NULL; given_username = (guint8*)ep_tvb_memdup(user_tvb,0,-1); - given_engine_len = tvb_ensure_length_remaining(engine_tvb,0); given_engine = (guint8*)ep_tvb_memdup(engine_tvb,0,-1); for (a = localized_ues; a; a = a->next) { -- cgit v1.2.3