Patchwork D1948: lazymanifest: avoid reading uninitialized memory

login
register
mail settings
Submitter phabricator
Date Jan. 31, 2018, 4:35 a.m.
Message ID <f36c7f07e8e65c5877d779344926bc08@localhost.localdomain>
Download mbox | patch
Permalink /patch/27085/
State Not Applicable
Headers show

Comments

phabricator - Jan. 31, 2018, 4:35 a.m.
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




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

Patch

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;
 		}