changeset 40475:7542466b94e2 stable

revlog: cache delta base value under -1 Such base are invalid so we better report them early.
author Boris Feld <boris.feld@octobus.net>
date Sun, 30 Dec 2018 16:11:06 +0100
parents f4113489e4d4
children fbd5e2f0bba7
files mercurial/cext/revlog.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
 }