forked from osmocom/wireshark
USB: allow usb string descriptor short read
Some drivers do a probing access to the descriptor to fetch just the length field Change-Id: Idd07a1e66800afcc838beb795594a4505ce13e82 Reviewed-on: https://code.wireshark.org/review/12250 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
parent
1acb2816bd
commit
6952c1c54f
|
@ -1615,8 +1615,10 @@ dissect_usb_string_descriptor(packet_info *pinfo _U_, proto_tree *parent_tree,
|
|||
}
|
||||
} else {
|
||||
/* UTF-16 string */
|
||||
proto_tree_add_item(tree, hf_usb_bString, tvb, offset, len-2, ENC_UTF_16 | ENC_LITTLE_ENDIAN);
|
||||
offset += len-2;
|
||||
/* handle case of host requesting only substring */
|
||||
guint8 len_str = MIN(len-2, usb_trans_info->setup.wLength -2);
|
||||
proto_tree_add_item(tree, hf_usb_bString, tvb, offset, len_str, ENC_UTF_16 | ENC_LITTLE_ENDIAN);
|
||||
offset += len_str;
|
||||
}
|
||||
|
||||
proto_item_set_len(item, offset-old_offset);
|
||||
|
|
Loading…
Reference in New Issue