Commit c4aa8d267cd67dbdefc96923d04071e6a6ee6361

Con Kolivas 2012-10-05T19:02:10

Clear the buffer data before sprinting to it.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/cgminer.c b/cgminer.c
index b5f82cb..49f9c4f 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2772,6 +2772,7 @@ static void *submit_work_thread(void *userdata)
 		nonce = *((uint32_t *)(work->data + 76));
 		noncehex = bin2hex((const unsigned char *)&nonce, 4);
 
+		memset(s, 0, 1024);
 		sprintf(s, "{\"params\": [\"%s\", \"%s\", \"%s\", \"%s\", \"%s\"], \"id\": %d, \"method\": \"mining.submit\"}",
 			pool->rpc_user, work->job_id, work->nonce2, work->ntime, noncehex, sshare->id);
 		free(noncehex);