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

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

Test Case IDCandidate153482
Bad / Good / MixedBadBad test case
AuthorIARPA STONESOUP Test and Evaluation team
Test suite: 102  
Application: 6  
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 creates a buffer on the stack of 1024 bytes and buffer on the heap of 64 bytes. It copies the taint source into the 1024-char buffer. It checks if the length of the taint source is less than the length of the 64-byte buffer. If it is, it uses strncpy to copy the taint source into the 64-byte buffer, with a maximum value of 1024 bytes. However, strncpy always writes the maximum number of bytes, and so writes 1024 bytes. This overflows the other data in the heap, including memory reserved for use by the memory manager. When the test case attempts to free the heap-allocated buffer, a glibc error occurs.
- Base program: Tree
- Source Taint: SOCKET
- Data Type: SIMPLE
- Data Flow: BASIC
- Control Flow: SEQUENCE

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

File Contains:
CWE-806: Buffer Access Using Size of Source Buffer on line(s): 590, 591, 592, 593, 594