From 5f9cacbf326cacb8162f2a5b5fd7ca839f09ae52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eliseo=20Marti=CC=81nez?= Date: Thu, 13 Nov 2014 19:17:52 +0100 Subject: [PATCH] Fix warnings: spell.c: store_aff_word(): Garbage value: RI. Problem : Result of operation is garbage or undefined @ 5809. Diagnostic : Real issue. Rationale : When copying flags, first access to `use_pfxlist[use_pfxlen]` was garbage if `spin->si_compflags` was null. Resolution : Make sure `use_pfxlist[use_pfxlen]` always has a value (NUL if `spin->si_compflags` is NULL). --- src/nvim/spell.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nvim/spell.c b/src/nvim/spell.c index a760691ad3..c3059d6b0b 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -5804,6 +5804,8 @@ store_aff_word ( // Get compound IDS from the affix list. get_compflags(affile, ae->ae_flags, use_pfxlist + use_pfxlen); + else + use_pfxlist[use_pfxlen] = NUL; // Combine the list of compound flags. // Concatenate them to the prefix IDs list.