(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-nasdaq-soup.c) |
| |
| 154 | | | dissect_nasdaq_soup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) |
| 155 | | | { |
| 156 | | | proto_item *ti; |
| 157 | | | proto_tree *nasdaq_soup_tree = NULL; |
| 158 | | | guint8 nasdaq_soup_type; |
| 159 | | | int linelen; |
| 160 | | | gint next_offset; |
| 161 | | | int offset = 0; |
| 162 | | | gint col_info; |
| 163 | | | gint counter = 0; |
| 164 | | | |
| 165 | | | col_info = check_col(pinfo->cinfo, COL_INFO); |
Ignored Return Value
The return value of check_col() 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 check_col() is checked 100% 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 check_col() from the Ignored Return Value check, use configuration file parameter RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 166 | | | while (tvb_offset_exists(tvb, offset)) { |
| 167 | | | |
| 168 | | | linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, nasdaq_soup_desegment && pinfo->can_desegment); |
| 169 | | | if (linelen == -1) { |
| 170 | | | |
| 171 | | | |
| 172 | | | |
| 173 | | | |
| 174 | | | |
| 175 | | | |
| 176 | | | |
| 177 | | | pinfo->desegment_offset = offset; |
| 178 | | | pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT; |
| 179 | | | return; |
| 180 | | | } |
| 181 | | | |
| 182 | | | nasdaq_soup_type = tvb_get_guint8(tvb, offset); |
| 183 | | | if (counter == 0) { |
| 184 | | | if (check_col(pinfo->cinfo, COL_PROTOCOL)) |
| 185 | | | col_set_str(pinfo->cinfo, COL_PROTOCOL, "Nasdaq-SOUP"); |
| 186 | | | if (col_info) |
| 187 | | | col_clear(pinfo->cinfo, COL_INFO); |
| 188 | | | } |
| 189 | | | if (col_info ) { |
| 190 | | | if (counter) { |
| 191 | | | col_append_str(pinfo->cinfo, COL_INFO, "; "); |
| 192 | | | col_set_fence(pinfo->cinfo, COL_INFO); |
| 193 | | | } |
| 194 | | | col_append_str(pinfo->cinfo, COL_INFO, val_to_str(nasdaq_soup_type, message_types_val, "Unknown packet type (0x%02x)")); |
| 195 | | | } |
| 196 | | | counter++; |
| 197 | | | if (tree) { |
| 198 | | | ti = proto_tree_add_item(tree, proto_nasdaq_soup, tvb, offset, linelen +1, FALSE); |
| 199 | | | nasdaq_soup_tree = proto_item_add_subtree(ti, ett_nasdaq_soup); |
| 200 | | | } |
| 201 | | | dissect_nasdaq_soup_packet(tvb, pinfo, tree, nasdaq_soup_tree, offset, linelen); |
| 202 | | | offset = next_offset; |
| 203 | | | } |
| 204 | | | } |
| |