(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dnp.c) |
| |
| 1116 | | | dnp3_al_obj_procindex(tvbuff_t *tvb, int offset, guint8 al_objq_index, guint32 *al_ptaddr, proto_tree *item_tree) |
| 1117 | | | { |
| 1118 | | | int indexbytes = 0; |
| 1119 | | | proto_item *index_item; |
| 1120 | | | |
| 1121 | | | switch (al_objq_index) |
| 1122 | | | { |
| 1123 | | | case AL_OBJQL_IDX_NI: |
| 1124 | | | indexbytes = 0; |
Useless Assignment
This code assigns the variable the same value it already had. |
|
| 1125 | | | index_item = proto_tree_add_text(item_tree, tvb, offset, 0, "Point Index: %u", *al_ptaddr); |
| 1126 | | | PROTO_ITEM_SET_GENERATED(index_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
325 | #define PROTO_ITEM_SET_GENERATED(proto_item) \ |
326 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_GENERATED) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 1127 | | | break; |
| 1128 | | | case AL_OBJQL_IDX_1O:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dnp.c |
| |
207 | #define AL_OBJQL_IDX_1O 0x01 /* Objects are prefixed w/ 1-octet index */ |
| |
|
| 1129 | | | *al_ptaddr = tvb_get_guint8(tvb, offset); |
| 1130 | | | proto_tree_add_item(item_tree, hf_dnp3_al_index8, tvb, offset, 1, TRUE); |
| 1131 | | | indexbytes = 1; |
| 1132 | | | break; |
| 1133 | | | case AL_OBJQL_IDX_2O:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dnp.c |
| |
208 | #define AL_OBJQL_IDX_2O 0x02 /* Objects are prefixed w/ 2-octet index */ |
| |
|
| 1134 | | | *al_ptaddr = tvb_get_letohs(tvb, offset); |
| 1135 | | | proto_tree_add_item(item_tree, hf_dnp3_al_index16, tvb, offset, 2, TRUE); |
| 1136 | | | indexbytes = 2; |
| 1137 | | | break; |
| 1138 | | | case AL_OBJQL_IDX_4O:
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dnp.c |
| |
209 | #define AL_OBJQL_IDX_4O 0x03 /* Objects are prefixed w/ 4-octet index */ |
| |
|
| 1139 | | | *al_ptaddr = tvb_get_letohl(tvb, offset); |
| 1140 | | | proto_tree_add_item(item_tree, hf_dnp3_al_index32, tvb, offset, 4, TRUE); |
| 1141 | | | indexbytes = 4; |
| 1142 | | | break; |
| 1143 | | | } |
| 1144 | | | return indexbytes; |
| 1145 | | | } |
| |