fix a potential null dereference
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 7 Mar 2006 20:47:20 +0000 (20:47 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 7 Mar 2006 20:47:20 +0000 (20:47 +0000)
found in coverity cid:48

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17509 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-smb-pipe.c

index e1276d648204c6e360e00fee7d0df5cc89912c70..297b6796690e27a101e9f484e9a168adfdba22f3 100644 (file)
@@ -3532,7 +3532,7 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
        proto_item *pipe_item = NULL;
        proto_tree *pipe_tree = NULL;
        int offset;
-       int trans_subcmd;
+       int trans_subcmd=0;
        int function;
        int fid = -1;
        guint16 info_level;
@@ -3674,8 +3674,13 @@ dissect_pipe_smb(tvbuff_t *sp_tvb, tvbuff_t *s_tvb, tvbuff_t *pd_tvb,
 
                if (!pinfo->fd->flags.visited)
                        tri->trans_subcmd = trans_subcmd;
-       } else
-               trans_subcmd = tri->trans_subcmd;
+       } else {
+               if(tri){
+                       trans_subcmd = tri->trans_subcmd;
+               } else {
+                       return FALSE;
+               }
+        }
 
        if (tri == NULL) {
                /*