commit | e3d4685f1f716e0c516332101d85e0930f20fc59 | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Sat Aug 29 13:39:17 2020 +0200 |
committer | Bram Moolenaar <Bram@vim.org> | Sat Aug 29 13:39:17 2020 +0200 |
tree | 60b4b08d87d23ceb87227df3bedf8aa16305f21c | |
parent | 423a85a11a9d3d658906aea715fed7fe6aa83cd8 [diff] [blame] |
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)
diff --git a/src/scriptfile.c b/src/scriptfile.c index 27d0eb2..e075236 100644 --- a/src/scriptfile.c +++ b/src/scriptfile.c
@@ -1517,7 +1517,7 @@ 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 {