(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-vnc.c) |
| |
| 1952 | | | process_tight_rect_filter_palette(tvbuff_t *tvb, packet_info *pinfo, gint *offset, |
| 1953 | | | proto_tree *tree, gint *bits_per_pixel) |
| 1954 | | | { |
| 1955 | | | vnc_packet_t *per_packet_info; |
| 1956 | | | gint num_colors; |
| 1957 | | | guint palette_bytes; |
| 1958 | | | |
| 1959 | | | |
| 1960 | | | |
| 1961 | | | per_packet_info = p_get_proto_data(pinfo->fd, proto_vnc); |
Ignored Return Value
The return value of p_get_proto_data() 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 p_get_proto_data() is checked 97% 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 p_get_proto_data() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 1962 | | | |
| 1963 | | | VNC_BYTES_NEEDED(1);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-vnc.c |
| |
295 | #define VNC_BYTES_NEEDED(a) \ |
296 | if(a > (guint)tvb_length_remaining(tvb, *offset)) \ |
297 | return a; |
| |
|
Event 2:
Skipping " if". 1 > (guint)tvb_length_remaining(...) evaluates to false.
hide
|
|
| 1964 | | | proto_tree_add_item(tree, hf_vnc_tight_palette_num_colors, tvb, *offset, 1, FALSE); |
| 1965 | | | num_colors = tvb_get_guint8(tvb, *offset); |
| 1966 | | | *offset += 1; |
| 1967 | | | |
| 1968 | | | num_colors++; |
| 1969 | | | if (num_colors < 2) |
Event 3:
Taking true branch. num_colors < 2 evaluates to true.
hide
|
|
| 1970 | | | return 0; |
| 1971 | | | |
| 1972 | | | if (per_packet_info->depth == 24) |
| 1973 | | | palette_bytes = num_colors * 3; |
| 1974 | | | else |
| 1975 | | | palette_bytes = num_colors * per_packet_info->depth / 8; |
| 1976 | | | |
| 1977 | | | VNC_BYTES_NEEDED(palette_bytes);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-vnc.c |
| |
295 | #define VNC_BYTES_NEEDED(a) \ |
296 | if(a > (guint)tvb_length_remaining(tvb, *offset)) \ |
297 | return a; |
| |
|
| 1978 | | | proto_tree_add_item(tree, hf_vnc_tight_palette_data, tvb, *offset, palette_bytes, FALSE); |
| 1979 | | | *offset += palette_bytes; |
| 1980 | | | |
| 1981 | | | |
| 1982 | | | if (num_colors == 2) |
| 1983 | | | *bits_per_pixel = 1; |
| 1984 | | | else |
| 1985 | | | *bits_per_pixel = 8; |
| 1986 | | | |
| 1987 | | | return 0; |
| 1988 | | | } |
| |