diff options
| author | tomKPZ <tomKPZ@gmail.com> | 2022-03-08 08:51:11 -0800 |
|---|---|---|
| committer | tomKPZ <tomKPZ@gmail.com> | 2022-03-08 09:05:10 -0800 |
| commit | f709ba63907bb6aa7bf256c1d1fce83e17d5f0ff (patch) | |
| tree | 2615cb1843aba5b6ccea10ab29f909255611bbc5 /src/input_handler.cc | |
| parent | 82db91c58c59e2698ba679595d9198cbc7ad3d7d (diff) | |
Fix buffer overflow in parse_quoted
This fixes a crash when using kak-lsp with bash-language-server. The
issue is that the second read() in parse_quoted may read past the end of
the string. If this happens and the condition on line 126 is false,
then the loop on line 119 will continue to read past the end of the
buffer since it checks for state.pos != end instead of state.pos < end,
which will likely result in a crash. The fix is to add a check for the
buffer end before the second read. The added test fails without the
change and passes with the change.
Diffstat (limited to 'src/input_handler.cc')
0 files changed, 0 insertions, 0 deletions
