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
a6f05267
Commit
a6f05267
authored
Sep 27, 2015
by
Christian Brauner
Committed by
Stéphane Graber
Sep 29, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check return value of snprintf in mount_proc_if_needed()
Signed-off-by:
Christian Brauner
<
christianvanbrauner@gmail.com
>
Acked-by:
Serge E. Hallyn
<
serge.hallyn@ubuntu.com
>
parent
b3a9fe8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
utils.c
src/lxc/utils.c
+4
-0
No files found.
src/lxc/utils.c
View file @
a6f05267
...
...
@@ -1664,6 +1664,10 @@ int mount_proc_if_needed(const char *rootfs)
mypid
=
(
int
)
getpid
();
INFO
(
"I am %d, /proc/self points to '%s'"
,
mypid
,
link
);
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/proc"
,
rootfs
);
if
(
ret
<
0
||
ret
>=
MAXPATHLEN
)
{
SYSERROR
(
"proc path name too long"
);
return
-
1
;
}
if
(
linklen
<
0
)
/* /proc not mounted */
goto
domount
;
if
(
atoi
(
link
)
!=
mypid
)
{
...
...
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