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

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

Test Case IDCandidate153817
Bad / Good / MixedBadBad test case
AuthorIARPA STONESOUP Test and Evaluation team
Associations
Test suite: 102  
Application: 17  
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 allocates a buffer on the heap, copies the input string into it, and then capitalizes each letter in the buffer. It searches that buffer to see if it contains the letter 'E', using a while loop that increments the pointer to the buffer each time through the loop. When it finds a letter 'E', or reaches the end of the buffer, it frees the buffer, using the pointer that it may have incremented. If the input is the empty string, or has the letter 'E' (or 'e') as its first character, the free happens successfully. If the input is non-empty and does not have the letter 'E' as its first character, the free does not happen at the start of the buffer, resulting in a segfault.
Metadata
- Base program: FFmpeg
- Source Taint: ENVIRONMENT_VARIABLE
- Data Type: ARRAY
- Data Flow: INDEX_ALIAS_2
- Control Flow: MACROS
File(s)
Flaw

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

File Contains:
CWE-761: Free of Pointer not at Start of Buffer on line(s): 105, 106, 107