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
fe218ca3
Unverified
Commit
fe218ca3
authored
Sep 29, 2013
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crasher in get_ips
Check that the interface structure is not NULL before trying to access its members. Signed-off-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
a24b8712
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
lxccontainer.c
src/lxc/lxccontainer.c
+3
-0
No files found.
src/lxc/lxccontainer.c
View file @
fe218ca3
...
@@ -1305,6 +1305,9 @@ static char** lxcapi_get_ips(struct lxc_container *c, char* interface, char* fam
...
@@ -1305,6 +1305,9 @@ static char** lxcapi_get_ips(struct lxc_container *c, char* interface, char* fam
/* Iterate through the interfaces */
/* Iterate through the interfaces */
for
(
tempIfAddr
=
interfaceArray
;
tempIfAddr
!=
NULL
;
tempIfAddr
=
tempIfAddr
->
ifa_next
)
{
for
(
tempIfAddr
=
interfaceArray
;
tempIfAddr
!=
NULL
;
tempIfAddr
=
tempIfAddr
->
ifa_next
)
{
if
(
tempIfAddr
->
ifa_addr
==
NULL
)
continue
;
if
(
tempIfAddr
->
ifa_addr
->
sa_family
==
AF_INET
)
{
if
(
tempIfAddr
->
ifa_addr
->
sa_family
==
AF_INET
)
{
if
(
family
&&
strcmp
(
family
,
"inet"
))
if
(
family
&&
strcmp
(
family
,
"inet"
))
continue
;
continue
;
...
...
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