(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dissectors/packet-beep.c) |
| |
| 446 | | | dissect_beep_int(tvbuff_t *tvb, int offset, |
| 447 | | | proto_tree *tree, int hf, int *val, int *hfa[]) |
| 448 | | | { |
| 449 | | | proto_item *hidden_item; |
| 450 | | | int ival, ind = 0; |
| 451 | | | unsigned int i = num_len(tvb, offset); |
| 452 | | | guint8 int_buff[100]; |
| 453 | | | |
| 454 | | | memset(int_buff, '\0', sizeof(int_buff)); |
| 455 | | | |
| 456 | | | tvb_memcpy(tvb, int_buff, offset, MIN(sizeof(int_buff) - 1, i));
x /usr/include/glib-2.0/glib/gmacros.h |
| |
201 | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) |
| |
|
| 457 | | | |
| 458 | | | |
| 459 | | | |
| 460 | | | sscanf((gchar*)int_buff, "%d", &ival); |
Ignored Return Value
The return value of __isoc99_sscanf() 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.
- CodeSonar is configured to enforce Ignored Return Value checks for __isoc99_sscanf(). (To change the set of enforced Ignored Return Value checks, use configuration file parameters RETURN_CHECKER_CHECKED_FUNCS and RETURN_CHECKER_IGNORED_FUNCS).
Show: All events | Only primary events |
|
| 461 | | | |
| 462 | | | if (tree) { |
Event 2:
Taking true branch. tree evaluates to true.
hide
|
|
| 463 | | | proto_tree_add_uint(tree, hf, tvb, offset, i, ival); |
| 464 | | | } |
| 465 | | | |
| 466 | | | while (hfa[ind]) { |
| 467 | | | |
| 468 | | | hidden_item = proto_tree_add_uint(tree, *hfa[ind], tvb, offset, i, ival); |
| 469 | | | PROTO_ITEM_SET_HIDDEN(hidden_item);
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
319 | #define PROTO_ITEM_SET_HIDDEN(proto_item) \ |
320 | ((proto_item) ? FI_SET_FLAG((proto_item)->finfo, FI_HIDDEN) : 0) |
| |
x /home/sate/Testcases/c/cve/wireshark-1.2.0/epan/proto.h |
| |
246 | #define FI_SET_FLAG(fi, flag) (fi->flags = fi->flags | flag) |
| |
|
| 470 | | | ind++; |
| 471 | | | |
| 472 | | | } |
| 473 | | | |
| 474 | | | *val = ival; |
| 475 | | | |
| 476 | | | return i; |
| 477 | | | |
| 478 | | | } |
| |