From a09b7f2e2e248e967e100018944e65dfe781c84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eliseo=20Marti=CC=81nez?= Date: Thu, 13 Nov 2014 17:49:10 +0100 Subject: [PATCH] Fix warnings: spell.c: spell_read_aff(): Uninitialized arg: RI. Problem : Uninitialized argument value @ 4469. Diagnostic : Real issue. Rationale : Happens when a line contains a spell info item (NAME, HOME, VERSION, AUTHOR, EMAIL, COPYRIGHT), which expect a second item, but then the second item is not present. Resolution : Add guard (item count > 1) to failing branch. --- src/nvim/spell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 1a173cb8df..a760691ad3 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -4466,7 +4466,7 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname) || aff->af_pref.ht_used > 0) smsg((char_u *)_("FLAG after using flags in %s line %d: %s"), fname, lnum, items[1]); - } else if (spell_info_item(items[0])) { + } else if (spell_info_item(items[0]) && itemcnt > 1) { p = (char_u *)getroom(spin, (spin->si_info == NULL ? 0 : STRLEN(spin->si_info)) + STRLEN(items[0])