]> granicus.if.org Git - vim/commitdiff
patch 8.2.2171: valgrind warning for using uninitialized value v8.2.2171
authorBram Moolenaar <Bram@vim.org>
Sun, 20 Dec 2020 16:59:53 +0000 (17:59 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 20 Dec 2020 16:59:53 +0000 (17:59 +0100)
Problem:    Valgrind warning for using uninitialized value.
Solution:   Do not use "startp" or "endp" unless there is a match.

src/regexp_nfa.c
src/version.c

index da80ee92163148d273eca820029db85be8d043fe..cbfed49b59c8c0527af685e5a59c5f4610ee451e 100644 (file)
@@ -7236,7 +7236,7 @@ theend:
                        || (end->lnum == start->lnum && end->col < start->col))
            rex.reg_mmatch->endpos[0] = rex.reg_mmatch->startpos[0];
     }
-    else
+    else if (retval > 0)
     {
        if (rex.reg_match->endp[0] < rex.reg_match->startp[0])
            rex.reg_match->endp[0] = rex.reg_match->startp[0];
index 6e2e6abc5f7d0483db6a4702ef075ea8844381b2..d149c9b3f610334bea9a44cba2ed6eabc8026e46 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2171,
 /**/
     2170,
 /**/