(/home/sate/Testcases/c/cve/wireshark-1.2.0/epan/radius_dict.c) |
| |
| 2351 | | | static void Radiusensure_buffer_stack (void) |
| 2352 | | | { |
| 2353 | | | int num_to_alloc; |
| 2354 | | | |
| 2355 | | | if (!(yy_buffer_stack)) { |
Event 1:
Skipping " if". yy_buffer_stack evaluates to true.
hide
|
|
| 2356 | | | |
| 2357 | | | |
| 2358 | | | |
| 2359 | | | |
| 2360 | | | |
| 2361 | | | num_to_alloc = 1; |
| 2362 | | | (yy_buffer_stack) = (struct yy_buffer_state**)Radiusalloc |
| 2363 | | | (num_to_alloc * sizeof(struct yy_buffer_state*) |
| 2364 | | | ); |
| 2365 | | | if ( ! (yy_buffer_stack) ) |
| 2366 | | | YY_FATAL_ERROR( "out of dynamic memory in Radiusensure_buffer_stack()" ); |
| 2367 | | | |
| 2368 | | | memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); |
| 2369 | | | |
| 2370 | | | (yy_buffer_stack_max) = num_to_alloc; |
| 2371 | | | (yy_buffer_stack_top) = 0; |
| 2372 | | | return; |
| 2373 | | | } |
| 2374 | | | |
| 2375 | | | 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
|
|
| 2376 | | | |
| 2377 | | | |
| 2378 | | | int grow_size = 8 ; |
Event 3:
grow_size is set to 8.
hide
|
|
| 2379 | | | |
| 2380 | | | 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
|
|
| 2381 | | | (yy_buffer_stack) = (struct yy_buffer_state**)Radiusrealloc |
| 2382 | | | ((yy_buffer_stack), |
| 2383 | | | 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 Radiusrealloc() as the second argument. - This multiplication may overflow and it is used as the allocation size later.
See related event 4.
hide
|
|
| 2384 | [+] | | ); |
 |
| |