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
49ce8186
Unverified
Commit
49ce8186
authored
Apr 14, 2019
by
Stéphane Graber
Committed by
GitHub
Apr 14, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2936 from brauner/2019-04-14/issue_2935
cgroups: fix potential nullderef
parents
30a9d137
b53a0853
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
cgfsng.c
src/lxc/cgroups/cgfsng.c
+8
-8
No files found.
src/lxc/cgroups/cgfsng.c
View file @
49ce8186
...
...
@@ -522,13 +522,17 @@ static bool copy_parent_file(char *path, char *file)
*
lastslash
=
'\0'
;
parent_path
=
must_make_path
(
path
,
file
,
NULL
);
len
=
lxc_read_from_file
(
parent_path
,
NULL
,
0
);
if
(
len
<=
0
)
goto
on_error
;
if
(
len
<=
0
)
{
SYSERROR
(
"Failed to determine buffer size"
);
return
false
;
}
value
=
must_realloc
(
NULL
,
len
+
1
);
ret
=
lxc_read_from_file
(
parent_path
,
value
,
len
);
if
(
ret
!=
len
)
goto
on_error
;
if
(
ret
!=
len
)
{
SYSERROR
(
"Failed to read from parent file
\"
%s
\"
"
,
parent_path
);
return
false
;
}
*
lastslash
=
oldv
;
child_path
=
must_make_path
(
path
,
file
,
NULL
);
...
...
@@ -536,10 +540,6 @@ static bool copy_parent_file(char *path, char *file)
if
(
ret
<
0
)
SYSERROR
(
"Failed to write
\"
%s
\"
to file
\"
%s
\"
"
,
value
,
child_path
);
return
ret
>=
0
;
on_error:
SYSERROR
(
"Failed to read file
\"
%s
\"
"
,
child_path
);
return
false
;
}
/* Initialize the cpuset hierarchy in first directory of @gname and set
...
...
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