[PATCH] Fixing a memory corruption bug in string escaping

Aaron Ballman aaron at aaronballman.com
Tue Apr 30 18:03:18 PDT 2013


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Program.inc.patch
Type: application/octet-stream
Size: 846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130430/764659ed/attachment.obj>


More information about the llvm-commits mailing list