(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-bssgp.c) |
| |
| 3509 | | | decode_iei_lcs_client_type(bssgp_ie_t *ie, build_info_t *bi, int ie_start_offset) { |
| 3510 | | | const guint8 MASK_CATEGORY = 0xf0; |
| 3511 | | | const guint8 MASK_SUBTYPE = 0x0f; |
| 3512 | | | proto_item *ti, *pi; |
| 3513 | | | proto_tree *tf; |
| 3514 | | | guint8 data, category, subtype; |
| 3515 | | | |
| 3516 | | | static const value_string tab_category[] = { |
| 3517 | | | { 0, "Value Added Client" }, |
| 3518 | | | |
| 3519 | | | { 2, "PLMN Operator" }, |
| 3520 | | | { 3, "Emergency Services" }, |
| 3521 | | | { 4, "Lawful Intercept Services" }, |
| 3522 | | | { 0, NULL }, |
| 3523 | | | |
| 3524 | | | }; |
| 3525 | | | |
| 3526 | | | if (!bi->bssgp_tree) { |
| 3527 | | | bi->offset += ie->value_length; |
| 3528 | | | return; |
| 3529 | | | } |
| 3530 | | | ti = bssgp_proto_tree_add_ie(ie, bi, ie_start_offset); |
| 3531 | | | tf = proto_item_add_subtree(ti, ett_bssgp_lcs_client_type); |
| 3532 | | | |
| 3533 | | | data = tvb_get_guint8(bi->tvb, bi->offset); |
| 3534 | | | |
| 3535 | | | category = get_masked_guint8(data, MASK_CATEGORY); |
| 3536 | | | pi = proto_tree_add_bitfield8(tf, bi->tvb, bi->offset, MASK_CATEGORY); |
| 3537 | | | proto_item_append_text(pi, "Category: %s (%#x)", |
| 3538 | | | val_to_str(category, tab_category, "Reserved"), |
| 3539 | | | category); |
| 3540 | | | |
| 3541 | | | subtype = get_masked_guint8(data, MASK_SUBTYPE); |
Ignored Return Value
The return value of get_masked_guint8() 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_masked_guint8() is checked 98% 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_masked_guint8() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 3542 | | | pi = proto_tree_add_bitfield8(tf, bi->tvb, bi->offset, MASK_SUBTYPE); |
| 3543 | | | proto_item_append_text(pi, "Subtype: "); |
| 3544 | | | |
| 3545 | | | switch (category) { |
Event 2:
Executing default case.
hide
|
|
| 3546 | | | case 0: |
| 3547 | | | if (subtype == 0) { |
| 3548 | | | proto_item_append_text(pi, "Unspecified"); break; |
| 3549 | | | } |
| 3550 | | | else { |
| 3551 | | | proto_item_append_text(pi, "Reserved"); break; |
| 3552 | | | } |
| 3553 | | | |
| 3554 | | | case 2: |
| 3555 | | | switch (subtype) { |
| 3556 | | | case 0: proto_item_append_text(pi, "Unspecified"); break; |
| 3557 | | | case 1: proto_item_append_text(pi, "Broadcast service"); break; |
| 3558 | | | case 2: proto_item_append_text(pi, "O&M"); break; |
| 3559 | | | case 3: proto_item_append_text(pi, "Anonymous statistics"); break; |
| 3560 | | | case 4: proto_item_append_text(pi, "Target MS service support node"); break; |
| 3561 | | | default: proto_item_append_text(pi, "Reserved"); break; |
| 3562 | | | } |
| 3563 | | | break; |
| 3564 | | | case 3: |
| 3565 | | | case 4: |
| 3566 | | | if (subtype == 0) { |
| 3567 | | | proto_item_append_text(pi, "Unspecified"); break; |
| 3568 | | | } |
| 3569 | | | else { |
| 3570 | | | proto_item_append_text(pi, "Reserved"); break; |
| 3571 | | | } |
| 3572 | | | default: |
| 3573 | | | proto_item_append_text(pi, "Reserved"); break; |
| 3574 | | | } |
| 3575 | | | |
| 3576 | | | bi->offset++; |
| 3577 | | | } |
| |