What steps will reproduce the problem?
1. Insert a blank line at the end of dcov_paths.lst and run CodeCoverage
normally.
What is the expected output? What do you see instead?
Expected: Successful run. Actual: Access violation in ntdll.dll.
What version of the product are you using? On what operating system?
1.0 RC10, Delphi XE2, Win7 x64
Please provide any additional information below.
The problem due to is a bug in TCoverageConfiguration.ExpandEnvString:
These lines:
SetLength(Result, Size - 1);
ExpandEnvironmentStrings(PChar(APath), PChar(Result), Size);
should be:
SetLength(Result, Size);
ExpandEnvironmentStrings(PChar(APath), PChar(Result), Size);
Result := PChar(Result);
What's happening with the existing code is that the API call is overwriting
memory with the #0 at the end of the PChar string. It's only by pure luck that
it (usually) won't overwrite anything valuable.
-Steve
Original issue reported on code.google.com by pand...@telepath.com on 17 Oct 2014 at 11:28
Original issue reported on code.google.com by
pand...@telepath.com
on 17 Oct 2014 at 11:28