From 44e770904e938d0936dd3fb5d6f0c7351a10e17a Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 5 Jun 2014 17:10:43 +0000 Subject: [PATCH] Bugfix: initiate_stratum: Ensure extranonce2 size is not negative (which could lead to exploits later as too little memory gets allocated) Thanks to Mick Ayzenberg for finding this! --- util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util.c b/util.c index 873d8e59..1a3901bd 100644 --- a/util.c +++ b/util.c @@ -2392,7 +2392,8 @@ resend: goto out; } n2size = json_integer_value(json_array_get(res_val, 2)); - if (!n2size) { + if (n2size < 1) + { applog(LOG_INFO, "Failed to get n2size in initiate_stratum"); free(sessionid); free(nonce1);