From 96815040483351ce80db92b50cd6f5d6a17b76b6 Mon Sep 17 00:00:00 2001 From: pooler Date: Fri, 8 Aug 2014 14:49:07 +0200 Subject: [PATCH] Check for negative extranonce2_size --- util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util.c b/util.c index 9be17f6..3bdac5e 100644 --- a/util.c +++ b/util.c @@ -1088,6 +1088,10 @@ start: applog(LOG_ERR, "Failed to get extranonce2_size"); goto out; } + if (xn2_size < 0 || xn2_size > 100) { + applog(LOG_ERR, "Invalid value of extranonce2_size"); + goto out; + } pthread_mutex_lock(&sctx->work_lock); free(sctx->session_id);