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

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

Test Case IDCandidate153365
Bad / Good / MixedBadBad test case
AuthorIARPA STONESOUP Test and Evaluation team
Test suite: 102  
Application: 18  
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 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.
- Base program: Gimp
- Source Taint: SHARED_MEMORY
- Data Type: TYPEDEF
- Data Flow: ADDRESS_ALIAS_50
- Control Flow: SEQUENCE

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

File Contains:
CWE-170: Improper Null Termination on line(s): 582, 583, 584, 585, 586, 587, 588, 589