(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-ntlmssp.c) |
| |
| 361 | | | dissect_ntlmssp_string (tvbuff_t *tvb, int offset, |
| 362 | | | proto_tree *ntlmssp_tree, |
| 363 | | | gboolean unicode_strings, |
| 364 | | | int string_hf, int *start, int *end, |
| 365 | | | const char **stringp) |
| 366 | | | { |
| 367 | | | proto_tree *tree = NULL; |
| 368 | | | proto_item *tf = NULL; |
| 369 | | | gint16 string_length = tvb_get_letohs(tvb, offset); |
| 370 | | | gint16 string_maxlen = tvb_get_letohs(tvb, offset+2); |
| 371 | | | gint32 string_offset = tvb_get_letohl(tvb, offset+4); |
| 372 | | | const char *string_text = NULL; |
| 373 | | | int result_length; |
| 374 | | | guint16 bc; |
| 375 | | | |
| 376 | | | *start = (string_offset > offset+8 ? string_offset : offset+8); |
| 377 | | | if (0 == string_length) { |
| 378 | | | *end = *start; |
| 379 | | | if (ntlmssp_tree) |
| 380 | | | proto_tree_add_string(ntlmssp_tree, string_hf, tvb, |
| 381 | | | offset, 8, "NULL"); |
| 382 | | | if (stringp != NULL) |
| 383 | | | *stringp = ""; |
| 384 | | | return offset+8; |
| 385 | | | } |
| 386 | | | |
| 387 | | | bc = result_length = string_length; |
| 388 | | | string_text = get_unicode_or_ascii_string(tvb, &string_offset, |
| 389 | | | unicode_strings, &result_length, |
| 390 | | | FALSE, TRUE, &bc); |
Ignored Return Value
The return value of get_unicode_or_ascii_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 get_unicode_or_ascii_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 get_unicode_or_ascii_string() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 391 | | | if (stringp != NULL) |
Event 2:
Skipping " if". stringp != (void *)0 evaluates to false.
hide
|
|
| 392 | | | *stringp = string_text; |
| 393 | | | |
| 394 | | | if (ntlmssp_tree) { |
Event 3:
Skipping " if". ntlmssp_tree evaluates to false.
hide
|
|
| 395 | | | tf = proto_tree_add_string(ntlmssp_tree, string_hf, tvb, |
| 396 | | | string_offset, result_length, string_text); |
| 397 | | | tree = proto_item_add_subtree(tf, ett_ntlmssp_string); |
| 398 | | | } |
| 399 | | | proto_tree_add_uint(tree, hf_ntlmssp_string_len, |
| 400 | | | tvb, offset, 2, string_length); |
| 401 | | | offset += 2; |
| 402 | | | proto_tree_add_uint(tree, hf_ntlmssp_string_maxlen, |
| 403 | | | tvb, offset, 2, string_maxlen); |
| 404 | | | offset += 2; |
| 405 | | | proto_tree_add_uint(tree, hf_ntlmssp_string_offset, |
| 406 | | | tvb, offset, 4, string_offset); |
| 407 | | | offset += 4; |
| 408 | | | |
| 409 | | | *end = string_offset + string_length; |
| 410 | | | return offset; |
| 411 | | | } |
| |