summaryrefslogtreecommitdiff
path: root/src/misc2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-02-23 17:59:22 +0100
committerBram Moolenaar <Bram@vim.org>2017-02-23 17:59:22 +0100
commit24922ec23360e7ea7c5a803c9edf476bb6395b32 (patch)
treec23edca1b1a49453b68a57e4e4ae6c7e1d217b94 /src/misc2.c
parent354796c19a0a4a048017059a0281938cc0b8f09a (diff)
downloadvim-git-24922ec23360e7ea7c5a803c9edf476bb6395b32.tar.gz
patch 8.0.0357: crash when setting 'guicursor' to weird valuev8.0.0357
Problem: Crash when setting 'guicursor' to weird value. Solution: Avoid negative size. (Dominique Pelle, closes #1465)
Diffstat (limited to 'src/misc2.c')
-rw-r--r--src/misc2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/misc2.c b/src/misc2.c
index 71ca6d8f5..992e5c292 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -3472,11 +3472,12 @@ parse_shape_opt(int what)
while (*modep != NUL)
{
colonp = vim_strchr(modep, ':');
- if (colonp == NULL)
+ commap = vim_strchr(modep, ',');
+
+ if (colonp == NULL || (commap != NULL && commap < colonp))
return (char_u *)N_("E545: Missing colon");
if (colonp == modep)
return (char_u *)N_("E546: Illegal mode");
- commap = vim_strchr(modep, ',');
/*
* Repeat for all mode's before the colon.