From 6b61ae5034668d118121e14068e867ce9576c4b6 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 8 Aug 2014 21:21:36 +1000 Subject: [PATCH] Put a sanity check on the length of the btcsig --- src/ckpool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ckpool.c b/src/ckpool.c index 3c5529a1..b4828e33 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -1013,6 +1013,10 @@ static void parse_config(ckpool_t *ckp) } json_get_string(&ckp->btcaddress, json_conf, "btcaddress"); json_get_string(&ckp->btcsig, json_conf, "btcsig"); + if (ckp->btcsig && strlen(ckp->btcsig) > 38) { + LOGWARNING("Signature %s too long, truncating to 38 bytes", ckp->btcsig); + ckp->btcsig[38] = '\0'; + } json_get_int(&ckp->blockpoll, json_conf, "blockpoll"); json_get_int(&ckp->update_interval, json_conf, "update_interval"); json_get_string(&ckp->serverurl, json_conf, "serverurl");