Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c2ac0ce1
Commit
c2ac0ce1
authored
Oct 07, 2020
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge tag 'mariadb-10.4.15' into 10.4
parents
232715f5
a6e451dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
sql/wsrep_sst.cc
sql/wsrep_sst.cc
+42
-0
No files found.
sql/wsrep_sst.cc
View file @
c2ac0ce1
...
@@ -1823,6 +1823,35 @@ static int sst_donate_other (const char* method,
...
@@ -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,
...
@@ -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
())
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment