changeset 40799:7e6834ade51d

manifest: reject lines shorter than 42 bytes, not 22 Yuya correctly spotted during the review of f27f8e9ef1e73 that we're dealing with hexlified hashes here, and so it should be 42 bytes not 22. Differential Revision: https://phab.mercurial-scm.org/D5347
author Augie Fackler <augie@google.com>
date Thu, 29 Nov 2018 16:44:01 -0500
parents 567e164f89b8
children 773572e5cba2
files mercurial/cext/manifest.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cext/manifest.c	Sun Nov 11 20:05:38 2018 +0900
+++ b/mercurial/cext/manifest.c	Thu Nov 29 16:44:01 2018 -0500
@@ -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;