mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-20 21:13:00 +08:00
parse_execution.cpp: validate 'for' variable name
Fixes #5800 (that's a nice round number)
This commit is contained in:
parent
dd9a26715d
commit
8eb05f8731
|
@ -396,6 +396,11 @@ parse_execution_result_t parse_execution_context_t::run_for_statement(
|
|||
}
|
||||
}
|
||||
|
||||
if (!valid_var_name(for_var_name)) {
|
||||
report_error(var_name_node, L"invalid var name: %ls", for_var_name.c_str());
|
||||
return parse_execution_errored;
|
||||
}
|
||||
|
||||
for_block_t *fb = parser->push_block<for_block_t>();
|
||||
|
||||
// Now drive the for loop.
|
||||
|
|
Loading…
Reference in New Issue
Block a user