diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-29 13:39:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-29 13:39:17 +0200 |
commit | e3d4685f1f716e0c516332101d85e0930f20fc59 (patch) | |
tree | 60b4b08d87d23ceb87227df3bedf8aa16305f21c /src/scriptfile.c | |
parent | 423a85a11a9d3d658906aea715fed7fe6aa83cd8 (diff) | |
download | vim-git-e3d4685f1f716e0c516332101d85e0930f20fc59.tar.gz |
patch 8.2.1539: using invalid script ID causes a crashv8.2.1539
Problem: Using invalid script ID causes a crash.
Solution: Check the script ID to be valid. (closes #6804)
Diffstat (limited to 'src/scriptfile.c')
-rw-r--r-- | src/scriptfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scriptfile.c b/src/scriptfile.c index 27d0eb2a5..e07523695 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c @@ -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 { |