Move minimum byte count test from dissect_scsi_smc_element() up into the calling dissect_scsi_smc_elements() so we can break out of the loop if we're not advancing through the packet. This fixes the infinite loop reported in http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2508

svn path=/trunk/; revision=25193
This commit is contained in:
Jeff Morriss 2008-04-29 12:27:32 +00:00
parent 1ad79116ed
commit 10a4936665
1 changed files with 10 additions and 7 deletions

View File

@ -290,8 +290,6 @@ dissect_scsi_smc_element (tvbuff_t *tvb, packet_info *pinfo _U_,
guint8 flags;
guint8 ident_len;
if (elem_bytecnt < 2)
return;
proto_tree_add_text (tree, tvb, offset, 2,
"Element Address: %u",
tvb_get_ntohs (tvb, offset));
@ -483,8 +481,13 @@ dissect_scsi_smc_elements (tvbuff_t *tvb, packet_info *pinfo,
while (desc_bytecnt != 0) {
elem_bytecnt = elem_desc_len;
if (elem_bytecnt > desc_bytecnt)
elem_bytecnt = desc_bytecnt;
if (elem_bytecnt < 2)
break;
dissect_scsi_smc_element (tvb, pinfo, tree, offset, elem_bytecnt,
elem_type, voltag_flags);
offset += elem_bytecnt;