D1948: lazymanifest: avoid reading uninitialized memory

quark (Jun Wu) phabricator at mercurial-scm.org
Tue Jan 30 23:35:58 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG113a30b87716: lazymanifest: avoid reading uninitialized memory (authored by quark, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1948?vs=5019&id=5020

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

AFFECTED FILES
  mercurial/cext/manifest.c

CHANGE DETAILS

diff --git a/mercurial/cext/manifest.c b/mercurial/cext/manifest.c
--- a/mercurial/cext/manifest.c
+++ b/mercurial/cext/manifest.c
@@ -778,11 +778,11 @@
 		PyObject *outer;
 		/* If we're looking at a deleted entry and it's not
 		 * the end of the manifest, just skip it. */
-		if (left->deleted && sneedle < self->numlines) {
+		if (sneedle < self->numlines && left->deleted) {
 			sneedle++;
 			continue;
 		}
-		if (right->deleted && oneedle < other->numlines) {
+		if (oneedle < other->numlines && right->deleted) {
 			oneedle++;
 			continue;
 		}



To: quark, #hg-reviewers, indygreg
Cc: mercurial-devel


More information about the Mercurial-devel mailing list