comparison src/misc2.c @ 10936:a516b6c279d9 v8.0.0357

patch 8.0.0357: crash when setting 'guicursor' to weird value commit https://github.com/vim/vim/commit/24922ec23360e7ea7c5a803c9edf476bb6395b32 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 23 17:59:22 2017 +0100 patch 8.0.0357: crash when setting 'guicursor' to weird value Problem: Crash when setting 'guicursor' to weird value. Solution: Avoid negative size. (Dominique Pelle, closes https://github.com/vim/vim/issues/1465)
author Christian Brabandt <cb@256bit.org>
date Thu, 23 Feb 2017 18:00:05 +0100
parents 905ab712979c
children 4e7308525fe7
comparison
equal deleted inserted replaced
10935:910486fdfd53 10936:a516b6c279d9
3470 #endif 3470 #endif
3471 modep = p_guicursor; 3471 modep = p_guicursor;
3472 while (*modep != NUL) 3472 while (*modep != NUL)
3473 { 3473 {
3474 colonp = vim_strchr(modep, ':'); 3474 colonp = vim_strchr(modep, ':');
3475 if (colonp == NULL) 3475 commap = vim_strchr(modep, ',');
3476
3477 if (colonp == NULL || (commap != NULL && commap < colonp))
3476 return (char_u *)N_("E545: Missing colon"); 3478 return (char_u *)N_("E545: Missing colon");
3477 if (colonp == modep) 3479 if (colonp == modep)
3478 return (char_u *)N_("E546: Illegal mode"); 3480 return (char_u *)N_("E546: Illegal mode");
3479 commap = vim_strchr(modep, ',');
3480 3481
3481 /* 3482 /*
3482 * Repeat for all mode's before the colon. 3483 * Repeat for all mode's before the colon.
3483 * For the 'a' mode, we loop to handle all the modes. 3484 * For the 'a' mode, we loop to handle all the modes.
3484 */ 3485 */