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
f1e05b90
Unverified
Commit
f1e05b90
authored
Jun 21, 2018
by
Donghwa Jeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: strncat => strlcat
Signed-off-by:
Donghwa Jeong
<
dh48.jeong@samsung.com
>
parent
3ebe2fbd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
conf.c
src/lxc/conf.c
+12
-13
No files found.
src/lxc/conf.c
View file @
f1e05b90
...
...
@@ -76,6 +76,10 @@
#include <sys/personality.h>
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#endif
#if IS_BIONIC
#include <../include/lxcmntent.h>
#else
...
...
@@ -841,6 +845,7 @@ static int lxc_setup_dev_symlinks(const struct lxc_rootfs *rootfs)
static
bool
append_ttyname
(
char
**
pp
,
char
*
name
)
{
char
*
p
;
size_t
size
;
if
(
!*
pp
)
{
*
pp
=
malloc
(
strlen
(
name
)
+
strlen
(
"container_ttys="
)
+
1
);
...
...
@@ -851,13 +856,14 @@ static bool append_ttyname(char **pp, char *name)
return
true
;
}
p
=
realloc
(
*
pp
,
strlen
(
*
pp
)
+
strlen
(
name
)
+
2
);
size
=
strlen
(
*
pp
)
+
strlen
(
name
)
+
2
;
p
=
realloc
(
*
pp
,
size
);
if
(
!
p
)
return
false
;
*
pp
=
p
;
strncat
(
p
,
" "
,
1
);
strncat
(
p
,
name
,
strlen
(
name
)
);
(
void
)
strlcat
(
p
,
" "
,
size
);
(
void
)
strlcat
(
p
,
name
,
size
);
return
true
;
}
...
...
@@ -1791,7 +1797,6 @@ static int lxc_setup_console(const struct lxc_rootfs *rootfs,
static
void
parse_mntopt
(
char
*
opt
,
unsigned
long
*
flags
,
char
**
data
,
size_t
size
)
{
struct
mount_opt
*
mo
;
size_t
cursize
;
/* If opt is found in mount_opt, set or clear flags.
* Otherwise append it to data. */
...
...
@@ -1806,16 +1811,10 @@ static void parse_mntopt(char *opt, unsigned long *flags, char **data, size_t si
}
}
cursize
=
strlen
(
*
data
);
if
(
cursize
)
cursize
+=
1
;
if
(
strlen
(
*
data
))
(
void
)
strlcat
(
*
data
,
","
,
size
);
if
(
size
-
cursize
>
1
)
{
if
(
cursize
)
strncat
(
*
data
,
","
,
1
);
strncat
(
*
data
,
opt
,
size
-
cursize
-
1
);
}
(
void
)
strlcat
(
*
data
,
opt
,
size
);
}
int
parse_mntopts
(
const
char
*
mntopts
,
unsigned
long
*
mntflags
,
char
**
mntdata
)
...
...
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