lix/src
Tuomas Tynkkynen a0e38c16bc libexpr: Recognize newline in more places in lexer
Flex's regexes have an annoying feature: the dot matches everything
except a newline. This causes problems for expressions like:

"${0}\
"

where the backslash-newline combination matches this rule instead of the
intended one mentioned in the comment:

    <STRING>\$|\\|\$\\ {
                    /* This can only occur when we reach EOF, otherwise the above
                    (...|\$[^\{\"\\]|\\.|\$\\.)+ would have triggered.
                    This is technically invalid, but we leave the problem to the
                    parser who fails with exact location. */
                    return STR;
                }
However, the parser actually accepts the resulting token sequence
('"' DOLLAR_CURLY 0 '}' STR '"'), which is a problem because the lexer
rule didn't assign anything to yylval. Ultimately this leads to a crash
when dereferencing a NULL pointer in ExprConcatStrings::bindVars().

The fix does change the syntax of the language in some corner cases
but I think it's only turning previously invalid (or crashing) syntax
to valid syntax. E.g.

"a\
b"

and

''a''\
b''

were previously syntax errors but now both result in "a\nb".

Found by afl-fuzz.
2018-03-02 17:30:48 +02:00
..
boost Shut up some warnings 2017-04-14 14:42:20 +02:00
build-remote Merge branch 'plugins' of https://github.com/shlevy/nix 2018-02-13 12:15:27 +01:00
buildenv Fix error message 2018-03-02 14:32:00 +01:00
libexpr libexpr: Recognize newline in more places in lexer 2018-03-02 17:30:48 +02:00
libmain Set backup MANPATH in case man path isn’t set correctly. 2018-02-15 10:20:02 -06:00
libstore Fix downloadCached() with a chroot store 2018-02-23 13:00:42 +01:00
libutil nix run: Fix segfault on macOS 2018-02-26 18:29:40 +01:00
linenoise linenoise.cpp: allow completions from empty input 2017-12-19 12:52:10 -06:00
nix nix run: Fix segfault on macOS 2018-02-26 18:29:40 +01:00
nix-build Add plugins to make Nix more extensible. 2018-02-08 12:44:37 -05:00
nix-channel Add plugins to make Nix more extensible. 2018-02-08 12:44:37 -05:00
nix-collect-garbage Add plugins to make Nix more extensible. 2018-02-08 12:44:37 -05:00
nix-copy-closure Add plugins to make Nix more extensible. 2018-02-08 12:44:37 -05:00
nix-daemon Add plugins to make Nix more extensible. 2018-02-08 12:44:37 -05:00
nix-env Add plugins to make Nix more extensible. 2018-02-08 12:44:37 -05:00
nix-instantiate Add plugins to make Nix more extensible. 2018-02-08 12:44:37 -05:00
nix-prefetch-url Add plugins to make Nix more extensible. 2018-02-08 12:44:37 -05:00
nix-store Add plugins to make Nix more extensible. 2018-02-08 12:44:37 -05:00
nlohmann nlohmann-json: 2.1.1 -> 3.0.1 2018-01-22 12:19:50 -06:00
resolve-system-dependencies Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00