Community
Participate
Working Groups
The Reader.cpp Windows event log reader program that is used to convert the log to a text file so it can be parsed by GLA should be cleaned up. There is some code that potentially could cause buffer overruns. For example the following code is included in GetDescriptionString: // Since the description text could not be retrieved get the message strings *pMessage = new char[(record->DataOffset - record->StringOffset) + 5]; DWORD recordStringStart = (DWORD)record + record->StringOffset; LPSTR recordString = (LPSTR)recordStringStart; // initialize the array to nulls memset(*pMessage, NULL, (record->DataOffset - record->StringOffset)); for (int i=0; i < record->NumStrings; i++) { removeNewLine(recordString); strcat(*pMessage, recordString); strcat(*pMessage, " "); recordStringStart = recordStringStart + strlen(recordString) + 1; recordString = (LPSTR)recordStringStart; } The array in pMessage may not be allocated large enough to hold all of the strings and the initialization of the array to NULL's does not cover all of the array (eg the 5 extra bytes allocated). This new array is not freed so there is a memory leak. The string returned by FormatMessage is never freed either. See documentation for FormatMessage. Also, comments should be added to the code to make it more maintainable.
This will be a candidate for fixing in 4.3.
Cannot contain in TPTP V4.3(i3)
Added sizing.
Targetting to i3 and increasing priority to indicate it is planned for 4.4.
Created attachment 65822 [details] Reader.cpp
Created attachment 65975 [details] Reader.cpp to address the memory leaking problem
Committed fixed reader.cpp file to TPTP Head CVS.
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this originator of this enhancement/defect has an inactive Bugzilla account and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.