tree-sitter/test
Phil Turnbull 035abc1e15 Add test for UTF16 out-of-bound read
utf16_iterate does not check that 'length' is a multiple of two which leads to
an out-of-bound read:

==105293== Conditional jump or move depends on uninitialised value(s)
==105293==    at 0x54F014: utf16_iterate (utf16.c:7)
==105293==    by 0x539251: string_iterate(TSInputEncoding, unsigned char const*, unsigned long, int*) (encoding_helpers.cc:15)
==105293==    by 0x53939D: string_byte_for_character(TSInputEncoding, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, unsigned long) (encoding_helpers.cc:43)
==105293==    by 0x507BAD: SpyInput::read(void*, unsigned int*) (spy_input.cc:47)
==105293==    by 0x551049: ts_lexer__get_chunk (lexer.c:29)
==105293==    by 0x5515C2: ts_lexer_start (lexer.c:152)
==105293==    by 0x5469AB: parser(long,...)(long long) (parser.c:297)
==105293==    by 0x547896: parser__get_lookahead (parser.c:439)
==105293==    by 0x54B2DF: parser__advance (parser.c:1150)
==105293==    by 0x54C2B6: parser_parse (parser.c:1348)
==105293==    by 0x53F06F: ts_document_parse_with_options (document.c:136)
==105293==    by 0x53EF4F: ts_document_parse (document.c:107)
2017-07-17 12:34:39 -07:00
..
compiler Fix compiler warnings in flatten_grammar_test 2017-07-14 10:26:34 -07:00
fixtures Support anonymous tokens inside of RENAME rules 2017-07-14 10:19:58 -07:00
fuzz Add libFuzzer support 2017-07-14 13:50:41 -07:00
helpers Support anonymous tokens inside of RENAME rules 2017-07-14 10:19:58 -07:00
integration Support anonymous tokens inside of RENAME rules 2017-07-14 10:19:58 -07:00
runtime Add test for UTF16 out-of-bound read 2017-07-17 12:34:39 -07:00
benchmarks.cc Represent all speeds as size_t in benchmarks 2017-07-06 12:24:41 -07:00
test_helper.h Rename spec -> test 2017-03-09 20:40:01 -08:00
tests.cc Rename spec -> test 2017-03-09 20:40:01 -08:00