From bac5831b355f916e0696b7bbcccfc51c057b729a 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 d1846437..16aa98a4 100644 --- a/util.c +++ b/util.c @@ -2505,7 +2505,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);