changeset 8785:1cb59cd2d382 v7.4.1681

commit https://github.com/vim/vim/commit/ef9d9b94a8803c405884bb6914ed745ede57c596 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 28 22:44:50 2016 +0200 patch 7.4.1681 Problem: Coverity warns for fixed size buffer length (false positive). Solution: Add a check for the name length.
author Christian Brabandt <cb@256bit.org>
date Mon, 28 Mar 2016 22:45:08 +0200
parents 26512223f779
children 687f048755f3
files src/eval.c src/version.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -933,6 +933,11 @@ eval_init(void)
     for (i = 0; i < VV_LEN; ++i)
     {
 	p = &vimvars[i];
+	if (STRLEN(p->vv_name) > 16)
+	{
+	    EMSG("INTERNAL: name too long, increase size of dictitem16_T");
+	    getout(1);
+	}
 	STRCPY(p->vv_di.di_key, p->vv_name);
 	if (p->vv_flags & VV_RO)
 	    p->vv_di.di_flags = DI_FLAGS_RO | DI_FLAGS_FIX;
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1681,
+/**/
     1680,
 /**/
     1679,