scsi opcode 0x7f is variable length so dont clamp the cdb length to 16 bytes
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>
Sat, 30 Sep 2006 01:01:57 +0000 (01:01 -0000)
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>
Sat, 30 Sep 2006 01:01:57 +0000 (01:01 -0000)
svn path=/trunk/; revision=19373

epan/dissectors/packet-iscsi.c

index 642bdcec8570e26eeb38fc2fae381b5818781ed2..af5a4f93c2ebfb01c358597fa43707b042dbfa03 100644 (file)
@@ -1489,14 +1489,21 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
                  ~I_BIT)) == ISCSI_OPCODE_SCSI_COMMAND) {
        tvbuff_t *cdb_tvb, *data_tvb;
        int tvb_len, tvb_rlen;
+       guint8 scsi_opcode;
 
         /* SCSI Command */
        tvb_len=tvb_length_remaining(tvb, cdb_offset);
-       if(tvb_len>16)
-           tvb_len=16;
        tvb_rlen=tvb_reported_length_remaining(tvb, cdb_offset);
-       if(tvb_rlen>16)
-           tvb_rlen=16;
+       scsi_opcode=tvb_get_guint8(tvb, cdb_offset);
+       /* cdb 0x7f is variable length so dont clamp the cdb tvb */
+       if(scsi_opcode!=0x7f){
+               if(tvb_len>16){
+                   tvb_len=16;
+               }
+               if(tvb_rlen>16){
+                   tvb_rlen=16;
+               }
+       }
        cdb_tvb=tvb_new_subset(tvb, cdb_offset, tvb_len, tvb_rlen);
         dissect_scsi_cdb(cdb_tvb, pinfo, tree, SCSI_DEV_UNKNOWN, &cdata->itlq, itl);
        /* we dont want the immediata below to overwrite our CDB info */