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
9c8b2b13
Unverified
Commit
9c8b2b13
authored
Jun 21, 2018
by
Donghwa Jeong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pam_cgfs: strncat => strlcat
Signed-off-by:
Donghwa Jeong
<
dh48.jeong@samsung.com
>
parent
f1e05b90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
pam_cgfs.c
src/lxc/pam/pam_cgfs.c
+10
-4
No files found.
src/lxc/pam/pam_cgfs.c
View file @
9c8b2b13
...
...
@@ -63,6 +63,10 @@
#include "include/strlcpy.h"
#endif
#ifndef HAVE_STRLCAT
#include "include/strlcat.h"
#endif
#define pam_cgfs_debug_stream(stream, format, ...) \
do { \
fprintf(stream, "%s: %d: %s: " format, __FILE__, __LINE__, \
...
...
@@ -1617,6 +1621,7 @@ static char *string_join(const char *sep, const char **parts, bool use_as_prefix
char
**
p
;
size_t
sep_len
=
strlen
(
sep
);
size_t
result_len
=
use_as_prefix
*
sep_len
;
size_t
buf_len
;
if
(
!
parts
)
return
NULL
;
...
...
@@ -1625,17 +1630,18 @@ static char *string_join(const char *sep, const char **parts, bool use_as_prefix
for
(
p
=
(
char
**
)
parts
;
*
p
;
p
++
)
result_len
+=
(
p
>
(
char
**
)
parts
)
*
sep_len
+
strlen
(
*
p
);
result
=
calloc
(
result_len
+
1
,
sizeof
(
char
));
buf_len
=
result_len
+
1
;
result
=
calloc
(
buf_len
,
sizeof
(
char
));
if
(
!
result
)
return
NULL
;
if
(
use_as_prefix
)
(
void
)
strlcpy
(
result
,
sep
,
(
result_len
+
1
)
*
sizeof
(
char
));
(
void
)
strlcpy
(
result
,
sep
,
buf_len
*
sizeof
(
char
));
for
(
p
=
(
char
**
)
parts
;
*
p
;
p
++
)
{
if
(
p
>
(
char
**
)
parts
)
strncat
(
result
,
sep
,
sep_len
);
strncat
(
result
,
*
p
,
strlen
(
*
p
));
(
void
)
strlcat
(
result
,
sep
,
buf_len
*
sizeof
(
char
)
);
(
void
)
strlcat
(
result
,
*
p
,
buf_len
*
sizeof
(
char
));
}
return
result
;
...
...
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