From 729049a7dae88daa8565f4991a9471a7a2ea677d Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Tue, 23 Sep 2014 21:37:18 -0700 Subject: [PATCH] Add error for when pushdata is exceptionally large --- lib/script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/script.js b/lib/script.js index 63376b2..149946c 100644 --- a/lib/script.js +++ b/lib/script.js @@ -267,6 +267,8 @@ Script.prototype.writeBuffer = function(buf) { opcodenum = Opcode.map.OP_PUSHDATA2; } else if (buf.length < Math.pow(2, 32)) { opcodenum = Opcode.map.OP_PUSHDATA4; + } else { + throw new Error("You can't push that much data"); } this.chunks.push({ buf: buf,