(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-edonkey.c) |
| |
| 1053 | | | static int dissect_kademlia_tag_hash_hidden(tvbuff_t *tvb, packet_info *pinfo _U_, |
| 1054 | | | int offset, proto_tree *tree) { |
| 1055 | | | proto_item *hidden_item; |
| 1056 | | | char *hash = ep_alloc(33); |
| 1057 | | | char hash_part[9]; |
| 1058 | | | int i = 0; |
| 1059 | | | |
| 1060 | | | for (i=0; i<=12; i+=4) { |
Useless Assignment
This code assigns the variable the same value it already had. |
|
| 1061 | | | if (i == 0) |
| 1062 | | | g_snprintf(hash, 33, "%08X", tvb_get_letohl(tvb, offset)); |
| 1063 | | | else { |
| 1064 | | | g_snprintf(hash_part, sizeof(hash_part), "%08X", tvb_get_letohl(tvb, offset + i)); |
| 1065 | | | hash = g_strconcat(hash, hash_part, NULL); |
| 1066 | | | } |
| 1067 | | | } |
| 1068 | | | |
| 1069 | | | |
| 1070 | | | hidden_item = proto_tree_add_string_format_value(tree, hf_kademlia_tag_hash, tvb, offset, 16, hash, "%s", hash); |
| 1071 | | | PROTO_ITEM_SET_HIDDEN(hidden_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 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) |
| |
|
| 1072 | | | |
| 1073 | | | return offset+16; |
| 1074 | | | } |
| |