Merge with crew-stable
authorBryan O'Sullivan <bryano@fb.com>
Mon, 13 Aug 2012 11:49:55 -0700
changeset 17354 c87ba0a6fb79
parent 17352 c6f88e7f95b7 (current diff)
parent 17353 bde1185f406c (diff)
child 17355 c25531ed58b0
child 17357 bd605568c5a0
Merge with crew-stable
--- a/mercurial/parsers.c	Sat Aug 11 12:45:53 2012 -0500
+++ b/mercurial/parsers.c	Mon Aug 13 11:49:55 2012 -0700
@@ -1084,8 +1084,10 @@
 		return NULL;
 	}
 
-	if (nodelen > 40)
-		nodelen = 40;
+	if (nodelen > 40) {
+		PyErr_SetString(PyExc_ValueError, "key too long");
+		return NULL;
+	}
 
 	for (i = 0; i < nodelen; i++)
 		hexdigit(node, i);