[PATCH 1 of 6 lazymanifest-errors] lazymanifest: check another error return in getitem

Augie Fackler raf at durin42.com
Thu Dec 31 19:05:45 UTC 2015


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1451586967 18000
#      Thu Dec 31 13:36:07 2015 -0500
# Node ID 0d56affe821052f6763f1796341d892c68339fa9
# Parent  7683ed1377dad6ece4dbe2276a8a166c77599a8d
lazymanifest: check another error return in getitem

diff --git a/mercurial/manifest.c b/mercurial/manifest.c
--- a/mercurial/manifest.c
+++ b/mercurial/manifest.c
@@ -394,6 +394,9 @@ static PyObject *lazymanifest_getitem(la
 		return NULL;
 	}
 	needle.start = PyString_AsString(key);
+	if (!needle.start) {
+		return NULL;
+	}
 	hit = bsearch(&needle, self->lines, self->numlines, sizeof(line),
 		      &linecmp);
 	if (!hit || hit->deleted) {


More information about the Mercurial-devel mailing list