mercurial/cext/revlog.c
branchstable
changeset 41019 7542466b94e2
parent 41018 f4113489e4d4
child 41129 074c72a38423
--- a/mercurial/cext/revlog.c	Thu Dec 27 23:34:37 2018 +0100
+++ b/mercurial/cext/revlog.c	Sun Dec 30 16:11:06 2018 +0100
@@ -863,6 +863,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;
 }