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

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Nov 29 21:44:14 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Yuya correctly spotted during the review of https://phab.mercurial-scm.org/rHGf27f8e9ef1e731723146b670a1a9a86e1a088069 that we're
  dealing with hexlified hashes here, and so it should be 42 bytes not
  22.

REPOSITORY
  rHG Mercurial

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

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



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list