Skip to content

Commit

Permalink
Bugfix: initiate_stratum: Ensure extranonce2 size is not negative (wh…
Browse files Browse the repository at this point in the history
…ich could lead to exploits later as too little memory gets allocated)

Thanks to Mick Ayzenberg <mick@dejavusecurity.com> for finding this!
  • Loading branch information
luke-jr authored and veox committed Jun 5, 2014
1 parent f0e47ec commit bac5831
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2505,7 +2505,8 @@ bool initiate_stratum(struct pool *pool)
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);
Expand Down

0 comments on commit bac5831

Please sign in to comment.