Back to the previous page
Test Case ID | ![]() |
Bad / Good / Mixed | Bad![]() |
Author | IARPA STONESOUP Test and Evaluation team |
Associations | Test suite: 102 Application: 6 |
Added by | Charles Oliveira |
Language | C |
Type of test case | Source Code |
Input string | |
Expected Output | |
Instructions | See src/INSTALL file for instructions on how to install. |
Submission date | 2015-10-06 |
Description | This test case implements a buffer that is used after it has been free()'d and it's memory allocated to another task. The test case takes a string as input and copies this string into an internal buffer allocated on the heap. For certain inputs (any string starting with an ASCII character with value of 'a' or higher) the buffer is then free()'d and it's memory is re allocated to a pointer to a buffer, which in tern is set to point to the input string. The original buffer is then filled with the input string again, overwriting the pointer if the memory had previously been free()'d. When this pointer is later accessed, if the use after free has occurred, a segfault will occur due to the corrupted memory the pointer references. Metadata - Base program: Tree - Source Taint: ENVIRONMENT_VARIABLE - Data Type: SIMPLE - Data Flow: BASIC - Control Flow: SEQUENCE |
File(s) |
|
Flaw |
There are no comments
Have any comments on this test case? Please,
.
- color.c
- service_mon.sh
- C-C416A-CTRE-01-ST01-DT02-DF11-CF20-01.xml
- runFifos.py
- C-C416A-CTRE-01-ST01-DT02-DF11-CF20-01.yaml
File Contains:
CWE-416: Use After Free on line(s): 583, 584, 585, 586, 587, 588, 589
CWE-416: Use After Free on line(s): 583, 584, 585, 586, 587, 588, 589