This test case reads entries from a comma-separated-value file. It expects to read 3 strings from a file in the format: double quote, up to 79 characters, double quote, comma; double quote, up to 79 characters, double quote, comma; and double quote, up to 79 characters, double quote. The test case then creates an array of 3 pointers, setting each pointer to NULL initially. It checks each string read from the file, and if the length of the string from the file is non-zero, it sets the corresponding pointer to that string. It then writes each of these three pointers to another file, using fputs. If the file is not in the format expected, the three strings will not be read in properly. Some of the pointers in the array of 3 pointers will then not be set correctly and will remain NULL. When the test case tries to write the strings to the output file, it will receive a segmentation fault on the fputs call.
- Base program: Subversion
- Source Taint: ENVIRONMENT_VARIABLE
- Data Type: VOID_POINTER
- Data Flow: ADDRESS_AS_FUNCTION_RETURN_VALUE
- Control Flow: INFINITE_LOOP
Have any comments on this test case? Please, send us an email.