(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-dmp.c) |
| |
| 2604 | | | static void dissect_dmp_structured_id (tvbuff_t *tvb, proto_tree *body_tree, |
| 2605 | | | gint offset) |
| 2606 | | | { |
| 2607 | | | proto_item *tf = NULL; |
| 2608 | | | guint8 id_byte; |
| 2609 | | | guint16 id_short; |
| 2610 | | | guint32 id_int; |
| 2611 | | | guint64 id_guint64; |
| 2612 | | | guint8 *id_string = NULL; |
| 2613 | | | gint length; |
| 2614 | | | |
| 2615 | | | offset += dmp_struct_offset; |
| 2616 | | | switch (dmp_struct_format) { |
| 2617 | | | |
| 2618 | | | case STRUCT_ID_UINT8: |
| 2619 | | | id_byte = tvb_get_guint8 (tvb, offset); |
| 2620 | | | g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%u", id_byte); |
| 2621 | | | tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint8, tvb, |
| 2622 | | | offset, 1, FALSE); |
| 2623 | | | break; |
| 2624 | | | |
| 2625 | | | case STRUCT_ID_UINT16: |
| 2626 | | | id_short = tvb_get_ntohs (tvb, offset); |
| 2627 | | | g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%u", id_short); |
| 2628 | | | tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint16, tvb, |
| 2629 | | | offset, 2, FALSE); |
| 2630 | | | break; |
| 2631 | | | |
| 2632 | | | case STRUCT_ID_UINT32: |
| 2633 | | | id_int = tvb_get_ntohl (tvb, offset); |
| 2634 | | | g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%u", id_int); |
| 2635 | | | tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint32, tvb, |
Unused Value
The value assigned to tf is never subsequently used on any execution path. |
|
| 2636 | | | offset, 4, FALSE); |
| 2637 | | | break; |
| 2638 | | | |
| 2639 | | | case STRUCT_ID_UINT64: |
| 2640 | | | id_guint64 = tvb_get_ntoh64 (tvb, offset); |
| 2641 | | | g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%" G_GINT64_MODIFIER "u", |
| 2642 | | | id_guint64); |
| 2643 | | | tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint64, tvb, |
| 2644 | | | offset, 8, FALSE); |
| 2645 | | | break; |
| 2646 | | | |
| 2647 | | | case STRUCT_ID_STRING: |
| 2648 | | | id_string = tvb_get_ephemeral_string (tvb, offset, (gint) dmp_struct_length); |
| 2649 | | | g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%s", id_string); |
| 2650 | | | tf = proto_tree_add_item (body_tree, hf_message_bodyid_string, tvb, |
| 2651 | | | offset, dmp_struct_length, FALSE); |
| 2652 | | | break; |
| 2653 | | | |
| 2654 | | | case STRUCT_ID_ZSTRING: |
| 2655 | | | id_string = tvb_get_ephemeral_stringz (tvb, offset, &length); |
| 2656 | | | g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%s", id_string); |
| 2657 | | | tf = proto_tree_add_item (body_tree, hf_message_bodyid_zstring, tvb, |
| 2658 | | | offset, length, FALSE); |
| 2659 | | | break; |
| 2660 | | | } |
| 2661 | | | } |
| |