(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-edonkey.c) |
| |
| 1032 | | | static int dissect_kademlia_hash(tvbuff_t *tvb, packet_info *pinfo _U_, |
| 1033 | | | int offset, proto_tree *tree, int *value_ptr) { |
| 1034 | | | char *hash = ep_alloc(33); |
| 1035 | | | char hash_part[9]; |
| 1036 | | | int i = 0; |
| 1037 | | | |
| 1038 | | | for (i=0; i<=12; i+=4) { |
Useless Assignment
This code assigns the variable the same value it already had. |
|
| 1039 | | | if (i == 0) |
| 1040 | | | g_snprintf(hash, 33, "%08X", tvb_get_letohl(tvb, offset)); |
| 1041 | | | else { |
| 1042 | | | g_snprintf(hash_part, sizeof(hash_part), "%08X", tvb_get_letohl(tvb, offset + i)); |
| 1043 | | | hash = g_strconcat(hash, hash_part, NULL); |
| 1044 | | | } |
| 1045 | | | } |
| 1046 | | | |
| 1047 | | | |
| 1048 | | | proto_tree_add_string_format_value(tree, *value_ptr, tvb, offset, 16, hash, "%s", hash); |
| 1049 | | | |
| 1050 | | | return dissect_kademlia_hash_hidden(tvb, pinfo, offset, tree); |
| 1051 | | | } |
| |