(/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)) |
| |
|
Event 1:
sizeof( int_buff ) - 1 < i evaluates to false.
hide
|
|
| 457 | | | |
| 458 | | | |
| 459 | | | |
| 460 | | | sscanf((gchar*)int_buff, "%d", &ival); |
Event 2:
__isoc99_sscanf() does not initialize ival. - This may be because of a failure case or other special case for __isoc99_sscanf(). Consult the __isoc99_sscanf() documentation for more information.
hide
|
|
| 461 | | | |
| 462 | | | if (tree) { |
Event 3:
Skipping " if". tree evaluates to false.
hide
|
|
| 463 | | | proto_tree_add_uint(tree, hf, tvb, offset, i, ival); |
| 464 | | | } |
| 465 | | | |
| 466 | | | while (hfa[ind]) { |
Event 5:
Continuing from loop body. Entering loop body. hfa[ind] evaluates to true.
hide
|
|
| 467 | | | |
| 468 | | | hidden_item = proto_tree_add_uint(tree, *hfa[ind], tvb, offset, i, ival); |
Uninitialized Variable
ival was not initialized. The issue can occur if the highlighted code executes. See related event 2. Show: All events | Only primary events |
|
| 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++; |
| |