Browse Source

Add sanity check for clients sending auth without having completed subscription

master
Con Kolivas 10 years ago
parent
commit
956be4d8b1
  1. 4
      src/stratifier.c

4
src/stratifier.c

@ -1471,6 +1471,10 @@ static json_t *parse_authorise(stratum_instance_t *client, json_t *params_val, j
*err_val = json_string("params missing array entries"); *err_val = json_string("params missing array entries");
goto out; goto out;
} }
if (unlikely(!client->useragent)) {
*err_val = json_string("Failed subscription");
goto out;
}
buf = json_string_value(json_array_get(params_val, 0)); buf = json_string_value(json_array_get(params_val, 0));
if (!buf) { if (!buf) {
*err_val = json_string("Invalid workername parameter"); *err_val = json_string("Invalid workername parameter");

Loading…
Cancel
Save