llvm-project/clang/unittests
Duncan P. N. Exon Smith 96a01fa046 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.  Moreover, we're seeing a lot of crash traces at calls to
`strlen()` inside of `lookupFilename()`, so something is going wrong
there.

Instead, use `strnlen()` to get the length, and check for corruption.

Also remove code paths that could call `StringRef(nullptr)`.  r261459
made these rather obvious (although they'd been there all along).

llvm-svn: 261461
2016-02-21 00:14:36 +00:00
..
AST Remove autoconf support 2016-01-26 21:30:40 +00:00
ASTMatchers Add an AST matcher for real floating-point types. e.g., float, double, long double, but not complex. 2016-02-18 16:36:01 +00:00
Basic Remove autoconf support 2016-01-26 21:30:40 +00:00
CodeGen Remove autoconf support 2016-01-26 21:30:40 +00:00
Driver Remove autoconf support 2016-01-26 21:30:40 +00:00
Format Remove use of builtin comma operator. 2016-02-18 22:34:54 +00:00
Frontend Use Backend_EmitMCNull for null codegen unit tests. 2016-02-18 20:27:16 +00:00
Lex Lex: Never overflow the file in HeaderMap::lookupFilename() 2016-02-21 00:14:36 +00:00
Rewrite Remove autoconf support 2016-01-26 21:30:40 +00:00
Sema Remove autoconf support 2016-01-26 21:30:40 +00:00
StaticAnalyzer Remove autoconf support 2016-01-26 21:30:40 +00:00
Tooling Stop using "template" when printing qualtype names 2016-02-16 20:34:27 +00:00
libclang tests: Add explicit -stdlib=libstdc++ to tests that require it 2016-02-12 07:48:28 +00:00
CMakeLists.txt [CMake] Don't build the libclang tests unless you're building libclang 2015-12-04 23:12:19 +00:00