teak-llvm/lldb/packages/Python/lldbsuite/test/expression_command
Pavel Labath 38c2059aec Fix segfault resulting from empty print prompt
Summary:
I have found a way to segfault lldb in 7 keystrokes! Steps to reproduce:
1) Launch lldb
2) Type `print` and hit enter. lldb will now prompt you to type a list of
    expressions, followed by an empty line.
3) Hit enter, indicating the end of your input.
4) Segfault!

After some investigation, I've found the issue in Host/common/Editline.cpp.
Editline::MoveCursor() relies on m_input_lines not being empty when the `to`
argument is CursorPosition::BlockEnd. This scenario, as far as I can tell,
occurs in one specific instance: In Editline::EndOrAddLineCommand() when the
list of lines being processed contains exactly one string (""). Meeting this
condition is fairly simple, I have posted steps to reproduce above.

Reviewers: krytarowski, zturner, labath

Reviewed By: labath

Subscribers: scott.smith, lldb-commits

Differential Revision: https://reviews.llvm.org/D32421
Patch by Alex Langford.

llvm-svn: 302225
2017-05-05 11:51:21 +00:00
..
anonymous-struct *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
calculator_mode Don't access the process in expressions w/o checking that 2016-11-03 23:42:09 +00:00
call-function *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
call-restarts *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
call-throws *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
char Add the radar number on our end. 2016-10-11 21:08:27 +00:00
expr-in-syscall *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
fixits Fix a crash in expressions with fixits in the dummy target. 2016-10-17 23:59:41 +00:00
formatters *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ir-interpreter *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ir-interpreter-phi-nodes *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
issue_11588 *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
macros *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
multiline Fix segfault resulting from empty print prompt 2017-05-05 11:51:21 +00:00
options *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
persist_objc_pointeetype Adding ivars in class extensions isn't supported on i386; skip a test. 2016-09-30 20:46:09 +00:00
persistent_ptr_update *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
persistent_types *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
persistent_variables *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
po_verbosity *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
radar_8638051 *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
radar_9531204 *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
radar_9673664 *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
save_jit_objects Fixup the xfail situation on Windows. 2016-10-05 20:47:17 +00:00
test *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
timeout *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
top-level *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
two-files *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
unwind_expression Fixup the xfail situation on Windows. 2016-10-05 20:47:17 +00:00
.categories