Back to the previous page
| Test Case ID | 153653 |
| Bad / Good / Mixed | Bad |
| Author | IARPA STONESOUP Test and Evaluation team |
| Associations | Test suite: 102 Application: 5 |
| Added by | Charles Oliveira |
| Language | C |
| Type of test case | Source Code |
| Input string | |
| Expected Output | |
| Instructions | See src/INSTALL file for instructions on how to install. |
| Submission date | 2015-10-06 |
| 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: PostgreSQL - Source Taint: ENVIRONMENT_VARIABLE - Data Type: HEAP_POINTER - Data Flow: INDEX_ALIAS_1 - Control Flow: CALLBACK |
| File(s) |
|
| Flaw |
There are no comments
Have any comments on this test case? Please,
.
- heapam.c
- runFifos.py
- service_mon.sh
- C-C170B-PSQL-07-ST01-DT04-DF07-CF01-01.xml
- C-C170B-PSQL-07-ST01-DT04-DF07-CF01-01.yaml
File Contains:
CWE-170: Improper Null Termination on line(s): 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275
CWE-170: Improper Null Termination on line(s): 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275

