(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-zbee-zdp-management.c) |
| |
| 918 | | | dissect_zbee_zdp_rsp_mgmt_nwkupdate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
| 919 | | | { |
| 920 | | | guint offset = 0; |
| 921 | | | guint i, j; |
| 922 | | | |
| 923 | | | guint8 status; |
| 924 | | | guint32 channels; |
| 925 | | | guint16 tx_total; |
| 926 | | | guint16 tx_fail; |
| 927 | | | guint8 channel_count; |
| 928 | | | |
| 929 | | | status = zdp_parse_status(tree, tvb, &offset); |
Ignored Return Value
The return value of zdp_parse_status() 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 zdp_parse_status() 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 zdp_parse_status() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 930 | | | channels = zdp_parse_chanmask(tree, tvb, &offset); |
| 931 | | | tx_total = zbee_parse_uint(tree, hf_zbee_zdp_tx_total, tvb, &offset, sizeof(guint16), NULL); |
| 932 | | | tx_fail = zbee_parse_uint(tree, hf_zbee_zdp_tx_fail, tvb, &offset, sizeof(guint16), NULL); |
| 933 | | | channel_count = zbee_parse_uint(tree, hf_zbee_zdp_channel_count, tvb, &offset, sizeof(guint8), NULL); |
| 934 | | | |
| 935 | | | |
| 936 | | | for (i=0, j=0; i<(8*sizeof(guint32)); i++) { |
| 937 | | | guint8 energy; |
| 938 | | | |
| 939 | | | if ( ! ((1<<i) & channels) ) { |
| 940 | | | |
| 941 | | | continue; |
| 942 | | | } |
| 943 | | | if (j>=channel_count) { |
| 944 | | | |
| 945 | | | break; |
| 946 | | | } |
| 947 | | | |
| 948 | | | energy = tvb_get_guint8(tvb, offset); |
| 949 | | | if (tree) { |
| 950 | | | proto_tree_add_text(tree, tvb, offset, sizeof(guint8), "Channel %d Energy = 0x%02x", i, energy); |
| 951 | | | } |
| 952 | | | offset += sizeof(guint8); |
| 953 | | | |
| 954 | | | j++; |
| 955 | | | } |
| 956 | | | |
| 957 | | | |
| 958 | | | zdp_dump_excess(tvb, offset, pinfo, tree); |
| 959 | | | } |
| |