(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-edonkey.c) |
| |
| 1076 | | | static int dissect_kademlia_tag_hash(tvbuff_t *tvb, packet_info *pinfo _U_, |
| 1077 | | | int offset, proto_tree *tree) { |
| 1078 | | | char *hash = ep_alloc(33); |
| 1079 | | | char hash_part[9]; |
| 1080 | | | int i = 0; |
| 1081 | | | |
| 1082 | | | for (i=0; i<=12; i+=4) { |
Useless Assignment
This code assigns the variable the same value it already had. |
|
| 1083 | | | if (i == 0) |
| 1084 | | | g_snprintf(hash, 33, "%08X", tvb_get_letohl(tvb, offset)); |
| 1085 | | | else { |
| 1086 | | | g_snprintf(hash_part, sizeof(hash_part), "%08X", tvb_get_letohl(tvb, offset + i)); |
| 1087 | | | hash = g_strconcat(hash, hash_part, NULL); |
| 1088 | | | } |
| 1089 | | | } |
| 1090 | | | |
| 1091 | | | |
| 1092 | | | proto_tree_add_string_format_value(tree, hf_kademlia_hash, tvb, offset, 16, hash, "%s", hash); |
| 1093 | | | return dissect_kademlia_tag_hash_hidden( tvb, pinfo, offset, tree ); |
| 1094 | | | } |
| |