mirror of https://github.com/SChernykh/p2pool
Made custom worker names safe for JSON data
And comma-separated lists too.pull/277/head
parent
ed56206c30
commit
10978c59e4
|
@ -197,8 +197,8 @@ static bool get_custom_user(const char* s, char (&user)[N])
|
||||||
if ((c == '+') || (c == '.')) {
|
if ((c == '+') || (c == '.')) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Limit to printable ASCII characters
|
// Limit to printable ASCII characters, also skip comma and JSON special characters
|
||||||
if (c >= ' ' && c <= '~') {
|
if (c >= ' ' && c <= '~' && c != ',' && c != '"' && c != '\\') {
|
||||||
user[len++] = c;
|
user[len++] = c;
|
||||||
}
|
}
|
||||||
++s;
|
++s;
|
||||||
|
|
Loading…
Reference in New Issue