Mercurial > hg
diff mercurial/cext/revlog.c @ 44500:864e9534d3d4 stable
cext-index: propagate inline_scan error in `index_deref`
Before this change, revlog index corruption could be silently ignored in some
situation.
Differential Revision: https://phab.mercurial-scm.org/D8276
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 12 Mar 2020 15:23:47 +0100 |
parents | f5d2720f3bea |
children | f8427841c8fc 3122058df7a5 |
line wrap: on
line diff
--- a/mercurial/cext/revlog.c Thu Mar 12 18:53:37 2020 +0100 +++ b/mercurial/cext/revlog.c Thu Mar 12 15:23:47 2020 +0100 @@ -157,7 +157,10 @@ sizeof(*self->offsets)); if (self->offsets == NULL) return (const char *)PyErr_NoMemory(); - inline_scan(self, self->offsets); + Py_ssize_t ret = inline_scan(self, self->offsets); + if (ret == -1) { + return NULL; + }; } return self->offsets[pos]; }