mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 19:41:14 -03: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:
committed by
ridiculousfish
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();
|
||||
|
||||
Reference in New Issue
Block a user