aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nbns.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-25 07:45:57 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-08-25 07:45:57 +0000
commitf47d44042fb586f1c87cfaee2dd848d48b51dcdb (patch)
treea1fe12ebb21489df08b39d67331a524c437b85e5 /epan/dissectors/packet-nbns.c
parentfc48d9aedce103a789520ead50dc8e2419752f45 (diff)
when tracking PDU bondaries, only do this IFF
the next few bytes match an SMB header. 1, SMB is the only important protocol transported atop NBSS 2, if we miss the first packets of a PDU, we DONT! want nbns to suddenly think there are Xmegabytes until the end of it and thus prevent any real PDUs from being dissected. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15527 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-nbns.c')
-rw-r--r--epan/dissectors/packet-nbns.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c
index e7f2b826f1..335a08a74e 100644
--- a/epan/dissectors/packet-nbns.c
+++ b/epan/dissectors/packet-nbns.c
@@ -1436,7 +1436,14 @@ dissect_nbss_packet(tvbuff_t *tvb, int offset, packet_info *pinfo,
* somewhere in the middle of a segment.
*/
if(!pinfo->fd->flags.visited){
- if((length+4)>tvb_reported_length_remaining(tvb, offset)){
+ /* 'Only' SMB is transported ontop of this so make sure
+ * there is an SMB header there ...
+ */
+ if( ((length+4)>tvb_reported_length_remaining(tvb, offset))
+ &&(tvb_length_remaining(tvb, offset)>=8)
+ &&(tvb_get_guint8(tvb,offset+5)=='S')
+ &&(tvb_get_guint8(tvb,offset+6)=='M')
+ &&(tvb_get_guint8(tvb,offset+7)=='B') ){
pinfo->want_pdu_tracking=2;
pinfo->bytes_until_next_pdu=(length+4)-tvb_reported_length_remaining(tvb, offset);
}