aboutsummaryrefslogtreecommitdiffstats
path: root/tap-smbstat.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-09-28 00:00:36 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-09-28 00:00:36 +0000
commit8b7b1ff28ed3664c42dc7ade08bc3d9c9a5927de (patch)
tree717f8ee3c5ba2053421d0d9aed5f2751de2fd3cb /tap-smbstat.c
parentfb1dff45b59ec15ab52f1723c5529c15ff816cf3 (diff)
Update to SMB service response time stats.
For short packets, we might not have enough of the payload to decode the transaction info levels and thus that data structure is NULL. check the pointer to this struct first before we try to dereference it. svn path=/trunk/; revision=8558
Diffstat (limited to 'tap-smbstat.c')
-rw-r--r--tap-smbstat.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tap-smbstat.c b/tap-smbstat.c
index 484de6abb2..6a383e61ae 100644
--- a/tap-smbstat.c
+++ b/tap-smbstat.c
@@ -1,7 +1,7 @@
/* tap-smbstat.c
* smbstat 2003 Ronnie Sahlberg
*
- * $Id: tap-smbstat.c,v 1.4 2003/04/25 20:54:16 guy Exp $
+ * $Id: tap-smbstat.c,v 1.5 2003/09/28 00:00:36 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -56,7 +56,7 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, void *psi
smbstat_t *ss=(smbstat_t *)pss;
smb_info_t *si=psi;
nstime_t delta;
- timestat_t *sp;
+ timestat_t *sp=NULL;
/* we are only interested in reply packets */
if(si->request){
@@ -71,12 +71,16 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, void *psi
smb_nt_transact_info_t *sti=(smb_nt_transact_info_t *)si->sip->extra_info;
/*nt transaction*/
- sp=&(ss->nt_trans[sti->subcmd]);
+ if(sti){
+ sp=&(ss->nt_trans[sti->subcmd]);
+ }
} else if(si->cmd==0x32){
smb_transact2_info_t *st2i=(smb_transact2_info_t *)si->sip->extra_info;
/*transaction2*/
- sp=&(ss->trans2[st2i->subcmd]);
+ if(st2i){
+ sp=&(ss->trans2[st2i->subcmd]);
+ }
} else {
sp=&(ss->proc[si->cmd]);
}
@@ -89,7 +93,9 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, void *psi
delta.secs--;
}
- time_stat_update(sp,&delta, pinfo);
+ if(sp){
+ time_stat_update(sp,&delta, pinfo);
+ }
return 1;
}