r261461 - Lex: Never overflow the file in HeaderMap::lookupFilename()

Rafael EspĂ­ndola via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 22 05:56:30 PST 2016


On 20 February 2016 at 19:14, Duncan P. N. Exon Smith via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
> Author: dexonsmith
> Date: Sat Feb 20 18:14:36 2016
> New Revision: 261461
>
> URL: http://llvm.org/viewvc/llvm-project?rev=261461&view=rev
> Log:
> Lex: Never overflow the file in HeaderMap::lookupFilename()
>
> If a header map file is corrupt, the strings in the string table may not
> be null-terminated.  The logic here previously relied on `MemoryBuffer`
> always being null-terminated, but this isn't actually guaranteed by the
> class AFAICT.

Depends on the constructor used. Note the RequiresNullTerminator
parameter. It exists because it apparently makes clang parsing faster
by allowing it to not check for the size all the time.

Cheers,
Rafael


More information about the cfe-commits mailing list