(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-hclnfsd.c) |
| |
| 165 | | | dissect_hclnfsd_authorize_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) |
| 166 | | | { |
| 167 | | | guint32 request_type; |
| 168 | | | char *ident = NULL; |
| 169 | | | char *username = NULL; |
| 170 | | | char *password = NULL; |
| 171 | | | int ident_len = 0; |
| 172 | | | int newoffset; |
| 173 | | | proto_item *ident_item = NULL; |
| 174 | | | proto_tree *ident_tree = NULL; |
| 175 | | | |
| 176 | | | proto_tree_add_item(tree, hf_hclnfsd_server_ip, tvb, offset, 4, FALSE); |
| 177 | | | offset += 4; |
| 178 | | | |
| 179 | | | request_type = tvb_get_ntohl(tvb, offset); |
| 180 | | | if (tree) |
| 181 | | | proto_tree_add_uint(tree, hf_hclnfsd_request_type, tvb, offset, |
| 182 | | | 4, request_type); |
| 183 | | | offset += 4; |
| 184 | | | |
| 185 | | | offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_device, offset, |
| 186 | | | NULL); |
| 187 | | | |
| 188 | | | if (tree) |
| 189 | | | { |
| 190 | | | ident_item = proto_tree_add_text(tree, tvb, offset, -1, |
| 191 | | | "Authentication Ident"); |
| 192 | | | |
| 193 | | | if (ident_item) |
| 194 | | | { |
| 195 | | | ident_tree = proto_item_add_subtree(ident_item, |
| 196 | | | ett_hclnfsd_auth_ident); |
| 197 | | | |
| 198 | | | if (ident_tree) |
| 199 | | | { |
| 200 | | | newoffset = dissect_rpc_string(tvb, ident_tree, |
| 201 | | | hf_hclnfsd_auth_ident_obscure, offset, &ident); |
Ignored Return Value
The return value of dissect_rpc_string() is never checked in the highlighted execution scenario. - If the return value can indicate an error, the error will be ignored if the highlighted code executes.
- The return value of dissect_rpc_string() is checked 99% of the time in this project. CodeSonar is configured to enforce Ignored Return Value checks for any function whose return value is checked at least 96% of the time, unless the function is used fewer than 20 times. (To modify these thresholds, use configuration file parameters RETURN_CHECKER_SAMPLE_SIZE and RETURN_CHECKER_RATIO. To exempt dissect_rpc_string() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 202 | | | |
| 203 | | | if (ident) |
Event 2:
Skipping " if". ident evaluates to false.
hide
|
|
| 204 | | | { |
| 205 | | | ident_len = (int)strlen(ident); |
| 206 | | | |
| 207 | | | proto_item_set_len(ident_item, ident_len); |
| 208 | | | |
| 209 | | | hclnfsd_decode_obscure(ident, ident_len); |
| 210 | | | |
| 211 | | | username = ident + 2; |
| 212 | | | password = username + strlen(username) + 1; |
| 213 | | | |
| 214 | | | proto_tree_add_text(ident_tree, tvb, offset, ident_len, |
| 215 | | | "Username: %s", username); |
| 216 | | | |
| 217 | | | proto_tree_add_text(ident_tree, tvb, offset, ident_len, |
| 218 | | | "Password: %s", password); |
| 219 | | | |
| 220 | | | offset = newoffset; |
| 221 | | | |
| 222 | | | ident = NULL; |
| 223 | | | } |
| 224 | | | } |
| 225 | | | } |
| 226 | | | } |
| 227 | | | |
| 228 | | | return offset; |
| 229 | | | } |
| |