[PATCH 5 of 6 lazymanifest-errors] lazymanifest: check forgotten error in contains

Augie Fackler raf at durin42.com
Thu Dec 31 13:05:49 CST 2015


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1451587530 18000
#      Thu Dec 31 13:45:30 2015 -0500
# Node ID 35ef7322aa717f45336e4441c9458d9a08862370
# Parent  47c7daf84a37ad5ebdeb89861d4f25429a7e1d13
lazymanifest: check forgotten error in contains

diff --git a/mercurial/manifest.c b/mercurial/manifest.c
--- a/mercurial/manifest.c
+++ b/mercurial/manifest.c
@@ -585,6 +585,9 @@ static int lazymanifest_contains(lazyman
 		return 0;
 	}
 	needle.start = PyString_AsString(key);
+	if (!needle.start) {
+		return -1;
+	}
 	hit = bsearch(&needle, self->lines, self->numlines, sizeof(line),
 		      &linecmp);
 	if (!hit || hit->deleted) {


More information about the Mercurial-devel mailing list