Mercurial > vim
comparison src/eval.c @ 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 | 65be74c1467b |
children | 33f5732d8932 |
comparison
equal
deleted
inserted
replaced
8784:26512223f779 | 8785:1cb59cd2d382 |
---|---|
931 hash_init(&func_hashtab); | 931 hash_init(&func_hashtab); |
932 | 932 |
933 for (i = 0; i < VV_LEN; ++i) | 933 for (i = 0; i < VV_LEN; ++i) |
934 { | 934 { |
935 p = &vimvars[i]; | 935 p = &vimvars[i]; |
936 if (STRLEN(p->vv_name) > 16) | |
937 { | |
938 EMSG("INTERNAL: name too long, increase size of dictitem16_T"); | |
939 getout(1); | |
940 } | |
936 STRCPY(p->vv_di.di_key, p->vv_name); | 941 STRCPY(p->vv_di.di_key, p->vv_name); |
937 if (p->vv_flags & VV_RO) | 942 if (p->vv_flags & VV_RO) |
938 p->vv_di.di_flags = DI_FLAGS_RO | DI_FLAGS_FIX; | 943 p->vv_di.di_flags = DI_FLAGS_RO | DI_FLAGS_FIX; |
939 else if (p->vv_flags & VV_RO_SBX) | 944 else if (p->vv_flags & VV_RO_SBX) |
940 p->vv_di.di_flags = DI_FLAGS_RO_SBX | DI_FLAGS_FIX; | 945 p->vv_di.di_flags = DI_FLAGS_RO_SBX | DI_FLAGS_FIX; |