(/home/sate/Testcases/c/cve/wireshark-1.2.0/text2pcap-scanner.c) |
| |
| 1466 | | | static void yyensure_buffer_stack (void) |
| 1467 | | | { |
| 1468 | | | int num_to_alloc; |
| 1469 | | | |
| 1470 | | | if (!(yy_buffer_stack)) { |
Event 1:
Skipping " if". yy_buffer_stack evaluates to true.
hide
|
|
| 1471 | | | |
| 1472 | | | |
| 1473 | | | |
| 1474 | | | |
| 1475 | | | |
| 1476 | | | num_to_alloc = 1; |
| 1477 | | | (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc |
| 1478 | | | (num_to_alloc * sizeof(struct yy_buffer_state*) |
| 1479 | | | ); |
| 1480 | | | if ( ! (yy_buffer_stack) ) |
| 1481 | | | YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); |
| 1482 | | | |
| 1483 | | | memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
| 1484 | | | |
| 1485 | | | (yy_buffer_stack_max) = num_to_alloc; |
| 1486 | | | (yy_buffer_stack_top) = 0; |
| 1487 | | | return; |
| 1488 | | | } |
| 1489 | | | |
| 1490 | | | if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ |
Event 2:
Taking true branch. yy_buffer_stack_top >= yy_buffer_stack_max - 1 evaluates to true.
hide
|
|
| 1491 | | | |
| 1492 | | | |
| 1493 | | | int grow_size = 8 ; |
Event 3:
grow_size is set to 8.
hide
|
|
| 1494 | | | |
| 1495 | | | num_to_alloc = (yy_buffer_stack_max) + grow_size; |
Event 4:
num_to_alloc is set to yy_buffer_stack_max + 8. - Determines the allocation size later.
See related event 3.
hide
|
|
| 1496 | | | (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc |
| 1497 | | | ((yy_buffer_stack), |
| 1498 | | | num_to_alloc * sizeof(struct yy_buffer_state*) |
Event 5:
4 * num_to_alloc, which evaluates to 4 * yy_buffer_stack_max + 32, is passed to yyrealloc() as the second argument. - This multiplication may overflow and it is used as the allocation size later.
See related event 4.
hide
|
|
| 1499 | [+] | | ); |
 |
| |