mirror of
https://github.com/MariaDB/server.git
synced 2025-05-29 21:42:28 +03:00
Merge tag 'mariadb-10.4.15' into 10.4
This commit is contained in:
commit
c2ac0ce1f0
@ -1823,6 +1823,35 @@ static int sst_donate_other (const char* method,
|
|||||||
return arg.err;
|
return arg.err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* return true if character can be a part of a filename */
|
||||||
|
static bool filename_char(int const c)
|
||||||
|
{
|
||||||
|
return isalnum(c) || (c == '-') || (c == '_') || (c == '.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return true if character can be a part of an address string */
|
||||||
|
static bool address_char(int const c)
|
||||||
|
{
|
||||||
|
return filename_char(c) ||
|
||||||
|
(c == ':') || (c == '[') || (c == ']') || (c == '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool check_request_str(const char* const str,
|
||||||
|
bool (*check) (int c))
|
||||||
|
{
|
||||||
|
for (size_t i(0); str[i] != '\0'; ++i)
|
||||||
|
{
|
||||||
|
if (!check(str[i]))
|
||||||
|
{
|
||||||
|
WSREP_WARN("Illegal character in state transfer request: %i (%c).",
|
||||||
|
str[i], str[i]);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int wsrep_sst_donate(const std::string& msg,
|
int wsrep_sst_donate(const std::string& msg,
|
||||||
const wsrep::gtid& current_gtid,
|
const wsrep::gtid& current_gtid,
|
||||||
const bool bypass)
|
const bool bypass)
|
||||||
@ -1834,8 +1863,21 @@ int wsrep_sst_donate(const std::string& msg,
|
|||||||
|
|
||||||
const char* method= msg.data();
|
const char* method= msg.data();
|
||||||
size_t method_len= strlen (method);
|
size_t method_len= strlen (method);
|
||||||
|
|
||||||
|
if (check_request_str(method, filename_char))
|
||||||
|
{
|
||||||
|
WSREP_ERROR("Bad SST method name. SST canceled.");
|
||||||
|
return WSREP_CB_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
const char* data= method + method_len + 1;
|
const char* data= method + method_len + 1;
|
||||||
|
|
||||||
|
if (check_request_str(data, address_char))
|
||||||
|
{
|
||||||
|
WSREP_ERROR("Bad SST address string. SST canceled.");
|
||||||
|
return WSREP_CB_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
wsp::env env(NULL);
|
wsp::env env(NULL);
|
||||||
if (env.error())
|
if (env.error())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user