Patchwork D8276: cext-index: propagate inline_scan error in `index_deref`

login
register
mail settings
Submitter phabricator
Date March 17, 2020, 3:04 a.m.
Message ID <e097af03c68dbb27a651a73dc0865830@localhost.localdomain>
Download mbox | patch
Permalink /patch/45802/
State Not Applicable
Headers show

Comments

phabricator - March 17, 2020, 3:04 a.m.
Closed by commit rHG864e9534d3d4: cext-index: propagate inline_scan error in `index_deref` (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8276?vs=20760&id=20806

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8276/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8276

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS




To: marmoute, #hg-reviewers, Alphare
Cc: mercurial-devel

Patch

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -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];
 	}