(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/dtd_parse.c) |
| |
| 1963 | | | static void Dtd_Parse_ensure_buffer_stack (void) |
| 1964 | | | { |
| 1965 | | | int num_to_alloc; |
| 1966 | | | |
| 1967 | | | if (!(yy_buffer_stack)) { |
Event 1:
Skipping " if". yy_buffer_stack evaluates to true.
hide
|
|
| 1968 | | | |
| 1969 | | | |
| 1970 | | | |
| 1971 | | | |
| 1972 | | | |
| 1973 | | | num_to_alloc = 1; |
| 1974 | | | (yy_buffer_stack) = (struct yy_buffer_state**)Dtd_Parse_alloc |
| 1975 | | | (num_to_alloc * sizeof(struct yy_buffer_state*) |
| 1976 | | | ); |
| 1977 | | | if ( ! (yy_buffer_stack) ) |
| 1978 | | | YY_FATAL_ERROR( "out of dynamic memory in Dtd_Parse_ensure_buffer_stack()" ); |
| 1979 | | | |
| 1980 | | | memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
| 1981 | | | |
| 1982 | | | (yy_buffer_stack_max) = num_to_alloc; |
| 1983 | | | (yy_buffer_stack_top) = 0; |
| 1984 | | | return; |
| 1985 | | | } |
| 1986 | | | |
| 1987 | | | 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
|
|
| 1988 | | | |
| 1989 | | | |
| 1990 | | | int grow_size = 8 ; |
Event 3:
grow_size is set to 8.
hide
|
|
| 1991 | | | |
| 1992 | | | 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
|
|
| 1993 | | | (yy_buffer_stack) = (struct yy_buffer_state**)Dtd_Parse_realloc |
| 1994 | | | ((yy_buffer_stack), |
| 1995 | | | 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 Dtd_Parse_realloc() as the second argument. - This multiplication may overflow and it is used as the allocation size later.
See related event 4.
hide
|
|
| 1996 | [+] | | ); |
 |
| |