changeset 17354:c87ba0a6fb79

Merge with crew-stable
author Bryan O'Sullivan <bryano@fb.com>
date Mon, 13 Aug 2012 11:49:55 -0700
parents c6f88e7f95b7 (current diff) bde1185f406c (diff)
children c25531ed58b0 bd605568c5a0
files
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);