Update deserialize.py
authordaeronmeyer <opensourceror@gmail.com>
Sun, 11 Aug 2013 20:20:22 +0000 (15:20 -0500)
committerdaeronmeyer <opensourceror@gmail.com>
Sun, 11 Aug 2013 20:20:22 +0000 (15:20 -0500)
Put additional length check in place to handle Block #251526 (see: https://bitcointalk.org/index.php?topic=271761 )

backends/bitcoind/deserialize.py

index 066be33..6620583 100644 (file)
@@ -293,7 +293,7 @@ def script_GetOp(bytes):
         vch = None
         opcode = ord(bytes[i])
         i += 1
-        if opcode >= opcodes.OP_SINGLEBYTE_END:
+        if opcode >= opcodes.OP_SINGLEBYTE_END and i < len(bytes):
             opcode <<= 8
             opcode |= ord(bytes[i])
             i += 1