From fc6972ceb218effb6cec35ecb8d469e8f6fa1a50 Mon Sep 17 00:00:00 2001 From: sahlberg Date: Thu, 21 Apr 2005 21:37:23 +0000 Subject: from Olivier J bugfix for IMPLICIT NULL in BER sequences and gsmmap updates git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14160 f5534014-38df-0310-8fa8-9805f1628bb7 --- epan/dissectors/packet-ber.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'epan/dissectors/packet-ber.c') diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c index c3f4793d8f..4bef42f16a 100644 --- a/epan/dissectors/packet-ber.c +++ b/epan/dissectors/packet-ber.c @@ -869,12 +869,15 @@ printf("SEQUENCE dissect_ber_sequence(%s) subdissector ate %d bytes\n",name,coun } #endif seq++; - offset = hoffset+count; - /* if it was optional and no bytes were eaten, - just try again. - */ - if((count==0)&&(seq->flags&BER_FLAGS_OPTIONAL)){ - goto ber_sequence_try_again; + if (len==0) { + offset = eoffset; + } else { + offset = hoffset+count; + } + /* if it was optional and no bytes were eaten and it was */ + /* supposed to (len<>0), just try again. */ + if((len!=0)&&(count==0)&&(seq->flags&BER_FLAGS_OPTIONAL)){ + goto ber_sequence_try_again; } } -- cgit v1.2.3