mercurial/cext/revlog.c
changeset 41129 074c72a38423
parent 41108 38e88450138c
parent 41019 7542466b94e2
child 41283 4948b327d3b9
--- a/mercurial/cext/revlog.c	Mon Jan 07 15:25:41 2019 -0800
+++ b/mercurial/cext/revlog.c	Mon Jan 07 19:03:23 2019 -0500
@@ -992,6 +992,13 @@
 		    rev, result);
 		return -2;
 	}
+	if (result < -1) {
+		PyErr_Format(
+		    PyExc_ValueError,
+		    "corrupted revlog, revision base out of range: %d, %d",
+		    rev, result);
+		return -2;
+	}
 	return result;
 }