SAMATE Logo NIST Logo The SAMATE Project Department of Homeland Security
Downloads:  Download this Test Case #153250

Back to the previous page... Back to the previous page

Test Case IDCandidate153250
Bad / Good / MixedBadBad test case
AuthorIARPA STONESOUP Test and Evaluation team
Test suite: 102  
Application: 6  
Added byCharles Oliveira
Type of test caseSource Code
Input string
Expected Output
See src/INSTALL file for instructions on how to install.
Submission date2015-10-06
DescriptionThis 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.
- Base program: Tree
- Data Type: SIMPLE
- Data Flow: BASIC
- Control Flow: SEQUENCE

There are no comments
Have any comments on this test case? Please, .

File Contains:
CWE-416: Use After Free on line(s): 583, 584, 585, 586, 587, 588, 589