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

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

Test Case IDCandidate153605
Bad / Good / MixedBadBad test case
AuthorIARPA STONESOUP Test and Evaluation team
Associations
Test suite: 102  
Application: 4  
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 an file read of 128 characters which does not properly null terminate the copied string if the original string is 128 characters in length or greater. The test case takes the name of a file, opens the file, and reads up to the first 128 characters into an internal buffer of size 128, allocated on the stack. This buffer is then copied via strcpy into a second stack allocated buffer of size 128, 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: OpenSSL
- Source Taint: ENVIRONMENT_VARIABLE
- Data Type: SIMPLE
- Data Flow: BASIC
- Control Flow: MACROS
File(s)
Flaw

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

File Contains:
CWE-170: Improper Null Termination on line(s): 887, 888, 889, 890, 891, 892, 893