Browse Source

Merge commit 'a419763' into bfgminer

Luke Dashjr 13 years ago
parent
commit
a155189470
1 changed files with 7 additions and 0 deletions
  1. 7 0
      util.c

+ 7 - 0
util.c

@@ -691,6 +691,13 @@ void real_block_target(unsigned char *target, const unsigned char *data)
 {
 	uint8_t targetshift;
 
+	if (unlikely(data[72] < 3 || data[72] > 0x20))
+	{
+		// Invalid (out of bounds) target
+		memset(target, 0xff, 32);
+		return;
+	}
+
 	targetshift = data[72] - 3;
 	memset(target, 0, targetshift);
 	target[targetshift++] = data[75];