mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.1539: using invalid script ID causes a crash
Problem: Using invalid script ID causes a crash. Solution: Check the script ID to be valid. (closes #6804)
This commit is contained in:
@@ -1517,7 +1517,7 @@ ex_scriptnames(exarg_T *eap)
|
||||
if (eap->addr_count > 0)
|
||||
{
|
||||
// :script {scriptId}: edit the script
|
||||
if (eap->line2 < 1 || eap->line2 > script_items.ga_len)
|
||||
if (!SCRIPT_ID_VALID(eap->line2))
|
||||
emsg(_(e_invarg));
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user