Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Chen Yisong
lxc
Commits
a495e1fd
Commit
a495e1fd
authored
Mar 30, 2016
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #932 from n-eiling/criu-log-fix
fix possible buffer overflow
parents
24d6495f
72a30576
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
criu.c
src/lxc/criu.c
+9
-5
No files found.
src/lxc/criu.c
View file @
a495e1fd
...
...
@@ -126,8 +126,8 @@ static void exec_criu(struct criu_opts *opts)
int
netnr
=
0
;
struct
lxc_list
*
it
;
char
buf
[
4096
],
*
pos
,
tty_info
[
32
];
char
buf
[
4096
],
tty_info
[
32
];
size_t
pos
;
/* If we are currently in a cgroup /foo/bar, and the container is in a
* cgroup /lxc/foo, lxcfs will give us an ENOENT if some task in the
* container has an open fd that points to one of the cgroup files
...
...
@@ -363,10 +363,14 @@ static void exec_criu(struct criu_opts *opts)
argv
[
argc
]
=
NULL
;
buf
[
0
]
=
0
;
pos
=
buf
;
pos
=
0
;
for
(
i
=
0
;
argv
[
i
];
i
++
)
{
pos
=
strncat
(
buf
,
argv
[
i
],
buf
+
sizeof
(
buf
)
-
pos
);
pos
=
strncat
(
buf
,
" "
,
buf
+
sizeof
(
buf
)
-
pos
);
ret
=
snprintf
(
buf
+
pos
,
sizeof
(
buf
)
-
pos
,
"%s "
,
argv
[
i
]);
if
(
ret
<
0
||
ret
>=
sizeof
(
buf
)
-
pos
)
goto
err
;
else
pos
+=
ret
;
}
INFO
(
"execing: %s"
,
buf
);
...
...
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