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
3d1b6f68
Commit
3d1b6f68
authored
Mar 21, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mariabackup: Ensure NUL termination in strncpy()
parent
630199e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
extra/mariabackup/backup_copy.cc
extra/mariabackup/backup_copy.cc
+2
-1
extra/mariabackup/xtrabackup.cc
extra/mariabackup/xtrabackup.cc
+7
-4
No files found.
extra/mariabackup/backup_copy.cc
View file @
3d1b6f68
...
...
@@ -2352,7 +2352,8 @@ static void rocksdb_copy_back() {
return
;
char
rocksdb_home_dir
[
FN_REFLEN
];
if
(
xb_rocksdb_datadir
&&
is_abs_path
(
xb_rocksdb_datadir
))
{
strncpy
(
rocksdb_home_dir
,
xb_rocksdb_datadir
,
sizeof
(
rocksdb_home_dir
));
strncpy
(
rocksdb_home_dir
,
xb_rocksdb_datadir
,
sizeof
rocksdb_home_dir
-
1
);
rocksdb_home_dir
[
sizeof
rocksdb_home_dir
-
1
]
=
'\0'
;
}
else
{
snprintf
(
rocksdb_home_dir
,
sizeof
(
rocksdb_home_dir
),
"%s/%s"
,
mysql_data_home
,
xb_rocksdb_datadir
?
trim_dotslash
(
xb_rocksdb_datadir
)
:
ROCKSDB_BACKUP_DIR
);
...
...
extra/mariabackup/xtrabackup.cc
View file @
3d1b6f68
...
...
@@ -2550,8 +2550,9 @@ xtrabackup_copy_datafile(fil_node_t* node, uint thread_n, const char *dest_name=
goto
error
;
}
strncpy
(
dst_name
,
(
dest_name
)
?
dest_name
:
cursor
.
rel_path
,
sizeof
(
dst_name
));
strncpy
(
dst_name
,
dest_name
?
dest_name
:
cursor
.
rel_path
,
sizeof
dst_name
-
1
);
dst_name
[
sizeof
dst_name
-
1
]
=
'\0'
;
/* Setup the page write filter */
if
(
xtrabackup_incremental
)
{
...
...
@@ -2871,7 +2872,8 @@ static void dbug_mariabackup_event(const char *event,const char *key)
if
(
slash
)
*
slash
=
'_'
;
}
else
{
strncpy
(
envvar
,
event
,
sizeof
(
envvar
));
strncpy
(
envvar
,
event
,
sizeof
envvar
-
1
);
envvar
[
sizeof
envvar
-
1
]
=
'\0'
;
}
char
*
sql
=
getenv
(
envvar
);
if
(
sql
)
{
...
...
@@ -4536,7 +4538,8 @@ void backup_fix_ddl(void)
const
char
*
extension
=
is_remote
?
".isl"
:
".ibd"
;
name
.
append
(
extension
);
char
buf
[
FN_REFLEN
];
strncpy
(
buf
,
name
.
c_str
(),
sizeof
(
buf
));
strncpy
(
buf
,
name
.
c_str
(),
sizeof
buf
-
1
);
buf
[
sizeof
buf
-
1
]
=
'\0'
;
const
char
*
dbname
=
buf
;
char
*
p
=
strchr
(
buf
,
'/'
);
if
(
p
==
0
)
{
...
...
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