mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 18:53:44 +08:00
Check that parser is not nullptr before calling libdata.
Avoids a possible nullptr dereference in parse_execution_context_t::check_end_execution
This commit is contained in:
parent
1b23e5471d
commit
321e1ed26a
|
@ -189,7 +189,10 @@ maybe_t<end_execution_reason_t> parse_execution_context_t::check_end_execution()
|
|||
if (shell_is_exiting()) {
|
||||
return end_execution_reason_t::cancelled;
|
||||
}
|
||||
if (parser && parser->cancellation_signal) {
|
||||
if (nullptr == parser) {
|
||||
return none();
|
||||
}
|
||||
if (parser->cancellation_signal) {
|
||||
return end_execution_reason_t::cancelled;
|
||||
}
|
||||
const auto &ld = parser->libdata();
|
||||
|
|
Loading…
Reference in New Issue
Block a user