mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 09:27:25 +00:00
stratum: more string params checks
This commit is contained in:
parent
ba20dc3ffa
commit
411a6c7343
1 changed files with 2 additions and 2 deletions
|
@ -202,7 +202,7 @@ bool client_authorize(YAAMP_CLIENT *client, json_value *json_params)
|
|||
return false;
|
||||
}
|
||||
|
||||
if(json_params->u.array.length>1)
|
||||
if(json_params->u.array.length>1 && json_params->u.array.values[1]->u.string.ptr)
|
||||
strncpy(client->password, json_params->u.array.values[1]->u.string.ptr, 1023);
|
||||
|
||||
if (g_list_client.count >= g_stratum_max_cons) {
|
||||
|
@ -210,7 +210,7 @@ bool client_authorize(YAAMP_CLIENT *client, json_value *json_params)
|
|||
return false;
|
||||
}
|
||||
|
||||
if(json_params->u.array.length>0)
|
||||
if(json_params->u.array.length>0 && json_params->u.array.values[0]->u.string.ptr)
|
||||
{
|
||||
strncpy(client->username, json_params->u.array.values[0]->u.string.ptr, 1023);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue