graphlog: attempt to fix index overrun (issue2912) stable
authorMatt Mackall <mpm@selenic.com>
Wed, 10 Aug 2011 13:25:35 -0500
branchstable
changeset 15032 eb87fbc6d702
parent 15026 f32a2989ff58
child 15033 2ef2d3a5cd2d
graphlog: attempt to fix index overrun (issue2912) This bug may be caused by file subgraphs have more than two parents per node. I have no idea if this fix is correct as the graphlog code is mysterious, but it seems to be fine on the available test case.
hgext/graphlog.py
--- a/hgext/graphlog.py	Fri Aug 05 00:39:54 2011 +0200
+++ b/hgext/graphlog.py	Wed Aug 10 13:25:35 2011 -0500
@@ -95,6 +95,8 @@
         elif start == end:
             interline[2 * start] = "|"
         else:
+            if 2 * end >= len(nodeline):
+                continue
             nodeline[2 * end] = "+"
             if start > end:
                 (start, end) = (end, start)