[PATCH 1 of 3 V2] lazymanifest: fail if path or hash strings cannot be created

Martin von Zweigbergk martinvonz at google.com
Thu Mar 12 18:14:32 CDT 2015


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1426106134 25200
#      Wed Mar 11 13:35:34 2015 -0700
# Node ID c13f6aa77c70ecb227cca08d9221de0492ff0848
# Parent  b7add2ebef9e41b91a1cd16a0cf149f517527cf0
lazymanifest: fail if path or hash strings cannot be created

While generating (path, hash, flags), we fail if flags cannot be
created. We should also fail if path or hash cannot be created.

diff -r b7add2ebef9e -r c13f6aa77c70 mercurial/manifest.c
--- a/mercurial/manifest.c	Wed Mar 11 08:28:56 2015 -0700
+++ b/mercurial/manifest.c	Wed Mar 11 13:35:34 2015 -0700
@@ -243,7 +243,7 @@
 	consumed = pl + 41;
 	flags = PyString_FromStringAndSize(l->start + consumed,
 									   l->len - consumed - 1);
-	if (!flags) {
+	if (!path || !hash || !flags) {
 		goto bail;
 	}
 	ret = PyTuple_Pack(3, path, hash, flags);


More information about the Mercurial-devel mailing list