]> git.neil.brown.name Git - wiggle.git/commitdiff
browse: fix buffer underflow when closing directories.
authorNeil Brown <neilb@suse.de>
Wed, 9 May 2012 03:10:03 +0000 (13:10 +1000)
committerNeil Brown <neilb@suse.de>
Wed, 9 May 2012 03:10:03 +0000 (13:10 +1000)
Signed-off-by: NeilBrown <neilb@suse.de>
vpatch.c

index b8586fcdd10d0e29c3f8099018ca9afb1c0f4c3b..d51633744384b7d6ddd60d669796704a09bddfe4 100644 (file)
--- a/vpatch.c
+++ b/vpatch.c
@@ -2121,6 +2121,8 @@ static int get_next(int pos, struct plist *pl, int n, int mode,
                        if (pos >= 0)
                                pos = pl[pos].next;
                }
+               if (pos < 0)
+                       return -1;
                if (pl[pos].calced == 0 && pl[pos].end)
                        calc_one(pl+pos, f, reverse);
                if (pl[pos].last >= 0)