Patchwork D5347: manifest: reject lines shorter than 42 bytes, not 22

login
register
mail settings
Submitter phabricator
Date Nov. 30, 2018, 12:07 p.m.
Message ID <022dd147599880380bb4a4bf503be2a3@localhost.localdomain>
Download mbox | patch
Permalink /patch/36877/
State Not Applicable
Headers show

Comments

phabricator - Nov. 30, 2018, 12:07 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG7e6834ade51d: manifest: reject lines shorter than 42 bytes, not 22 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5347?vs=12659&id=12662

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

AFFECTED FILES
  mercurial/cext/manifest.c

CHANGE DETAILS




To: durin42, #hg-reviewers
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
@@ -127,11 +127,11 @@ 
 		if (!next) {
 			return MANIFEST_MALFORMED;
 		}
-		if ((next - data) < 22) {
-			/* We should have at least 22 bytes in a line:
+		if ((next - data) < 42) {
+			/* We should have at least 42 bytes in a line:
 			   1 byte filename
 			   1 NUL
-			   20 bytes of hash
+			   40 bytes of hash
 			   so we can give up here.
 			*/
 			return MANIFEST_TOO_SHORT_LINE;