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

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

Test Case IDCandidate153818
Bad / Good / MixedBadBad test case
AuthorIARPA STONESOUP Test and Evaluation team
Associations
Test suite: 102  
Application: 18  
Added byCharles Oliveira
LanguageC
Type of test caseSource Code
Input string
Expected Output
Instructions
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.
Metadata
- Base program: Gimp
- Source Taint: SHARED_MEMORY
- Data Type: ARRAY
- Data Flow: ADDRESS_AS_VARIABLE
- Control Flow: RECURSIVE
File(s)
Flaw

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

File Contains:
CWE-416: Use After Free on line(s): 408, 409, 410, 411, 412, 413, 414