Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
394096b1
Commit
394096b1
authored
Aug 05, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
files-reg: Sanitize rlb and rlb->path malloc/rollback code flow
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
5552f9e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
files-reg.c
files-reg.c
+11
-8
No files found.
files-reg.c
View file @
394096b1
...
...
@@ -457,20 +457,23 @@ static int create_link_remap(char *path, int len, int lfd,
* we keep all data in memory.
*/
rlb
=
xmalloc
(
sizeof
(
*
rlb
));
if
(
rlb
)
rlb
->
path
=
strdup
(
link_name
)
;
if
(
!
rlb
)
goto
err1
;
if
(
!
rlb
||
!
rlb
->
path
)
{
pr_perror
(
"Can't register rollback for %s"
,
path
);
xfree
(
rlb
?
rlb
->
path
:
NULL
);
xfree
(
rlb
);
return
-
1
;
}
rlb
->
path
=
strdup
(
link_name
);
if
(
!
rlb
->
path
)
goto
err2
;
rlb
->
mnt_ns
=
nsid
;
list_add
(
&
rlb
->
list
,
&
link_remaps
);
return
pb_write_one
(
fdset_fd
(
glob_fdset
,
CR_FD_REG_FILES
),
&
rfe
,
PB_REG_FILE
);
err2:
xfree
(
rlb
);
err1:
pr_perror
(
"Can't register rollback for %s"
,
path
);
return
-
1
;
}
static
int
dump_linked_remap
(
char
*
path
,
int
len
,
const
struct
stat
*
ost
,
...
...
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