National Institute of Standards and Technology
Package illustrating a test case

Test case 153276

Description

This test case implements an file read of 16 characters which does not properly null terminate the copied string if the original string is 16 characters in length or greater. The test case takes the name of a file, opens the file, and reads up to the first 16 characters into an internal buffer of size 16, allocated on the stack. This buffer is then copied via strcpy into a heap allocated buffer of size 64, however, if the original file read did not copy a null terminator, the strcpy will copy everything it finds in memory after the input string until it encounters a null terminator. This will cause a buffer overflow and lead to a segfault.
Metadata
- Base program: Subversion
- Source Taint: ENVIRONMENT_VARIABLE
- Data Type: ARRAY
- Data Flow: BUFFER_ADDRESS_ARRAY_INDEX
- Control Flow: INDIRECTLY_RECURSIVE

Flaws

Test Suites

Documentation

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