Fix warning when compiling with -O3

/home/jmayer/work/wireshark/git/epan/dissectors/packet-lmp.c: In function ‘dissect_lmp’:
/home/jmayer/work/wireshark/git/epan/dissectors/packet-lmp.c:776:13: error: array subscript is below array bounds [-Werror=array-bounds]
        ti = proto_tree_add_item(lmp_tree,
             ^

Change-Id: Ie949b4280f71a8f9f480a8e1d6592098ee7e67b5
Reviewed-on: https://code.wireshark.org/review/3573
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
This commit is contained in:
Joerg Mayer 2014-08-13 14:33:34 +02:00 committed by Jörg Mayer
parent 633f1562ad
commit 9e560bc3f0
1 changed files with 4 additions and 3 deletions

View File

@ -761,6 +761,7 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
guint8 lmp_class;
guint8 type;
guint8 negotiable;
int filter_num;
const char *object_type;
obj_length = tvb_get_ntohs(tvb, offset+2);
@ -771,10 +772,10 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
hidden_item = proto_tree_add_uint(lmp_tree, hf_lmp_filter[LMPF_OBJECT], tvb,
offset, 1, lmp_class);
PROTO_ITEM_SET_GENERATED(hidden_item);
if (lmp_valid_class(lmp_class)) {
filter_num = lmp_class_to_filter_num(lmp_class);
if (filter_num != -1 && lmp_valid_class(lmp_class)) {
ti = proto_tree_add_item(lmp_tree,
hf_lmp_filter[lmp_class_to_filter_num(lmp_class)],
hf_lmp_filter[filter_num],
tvb, offset, obj_length, ENC_NA); /* all possibilities are FT_NONE */
} else {
expert_add_info_format(pinfo, hidden_item, &ei_lmp_invalid_class,