[PATCH] Fixing a memory corruption bug in string escaping

Aaron Ballman aaron at aaronballman.com
Tue Apr 30 19:53:32 PDT 2013


Thanks!  Fixed in r180836

~Aaron

On Tue, Apr 30, 2013 at 10:40 PM, Reid Kleckner <rnk at google.com> wrote:
> LGTM
>
> Aren't C strings awesome?  =/
>
> On Tue, Apr 30, 2013 at 6:03 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
>> There was a buffer overrun bug introduced in Programs.inc where the
>> buffer allocated with alloca wasn't large enough to accommodate the
>> closing quote escape rules in some instances.    The
>> CreateProcessTrailingSlash test in ProgramTest.cpp pointed out the
>> issue in debug builds from MSVC.
>>
>> This patch addresses the issue by accounting for any escapes that
>> happen prior to the trailing quote (this escaping happens on line 239
>> but was not happening when calculating the length of the string).
>>
>> ~Aaron



More information about the llvm-commits mailing list