diff options
Diffstat (limited to 'epan/dissectors/packet-ber.c')
-rw-r--r-- | epan/dissectors/packet-ber.c | 15 |
1 files changed, 9 insertions, 6 deletions
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; } } |