National Institute of Standards and Technology
Package illustrating a test case

Test case 153239

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: SOCKET
- Data Type: SIMPLE
- Data Flow: BASIC
- Control Flow: SEQUENCE

Flaws

Test Suites

Documentation

Have any comments on this test case? Please, send us an email.