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
fdcdb654
Unverified
Commit
fdcdb654
authored
Feb 05, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands_utils: remove stack allocations
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
5265a60c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
commands_utils.c
src/lxc/commands_utils.c
+3
-2
No files found.
src/lxc/commands_utils.c
View file @
fdcdb654
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include "initutils.h"
#include "initutils.h"
#include "log.h"
#include "log.h"
#include "lxclock.h"
#include "lxclock.h"
#include "memory_utils.h"
#include "monitor.h"
#include "monitor.h"
#include "state.h"
#include "state.h"
#include "utils.h"
#include "utils.h"
...
@@ -102,9 +103,9 @@ int lxc_make_abstract_socket_name(char *path, size_t pathlen,
...
@@ -102,9 +103,9 @@ int lxc_make_abstract_socket_name(char *path, size_t pathlen,
const
char
*
hashed_sock_name
,
const
char
*
hashed_sock_name
,
const
char
*
suffix
)
const
char
*
suffix
)
{
{
__do_free
char
*
tmppath
=
NULL
;
const
char
*
name
;
const
char
*
name
;
char
*
offset
;
char
*
offset
;
char
*
tmppath
;
size_t
len
;
size_t
len
;
size_t
tmplen
;
size_t
tmplen
;
uint64_t
hash
;
uint64_t
hash
;
...
@@ -153,7 +154,7 @@ int lxc_make_abstract_socket_name(char *path, size_t pathlen,
...
@@ -153,7 +154,7 @@ int lxc_make_abstract_socket_name(char *path, size_t pathlen,
/* ret >= len; lxcpath or name is too long. hash both */
/* ret >= len; lxcpath or name is too long. hash both */
tmplen
=
strlen
(
name
)
+
strlen
(
lxcpath
)
+
2
;
tmplen
=
strlen
(
name
)
+
strlen
(
lxcpath
)
+
2
;
tmppath
=
alloca
(
tmplen
);
tmppath
=
must_realloc
(
NULL
,
tmplen
);
ret
=
snprintf
(
tmppath
,
tmplen
,
"%s/%s"
,
lxcpath
,
name
);
ret
=
snprintf
(
tmppath
,
tmplen
,
"%s/%s"
,
lxcpath
,
name
);
if
(
ret
<
0
||
(
size_t
)
ret
>=
tmplen
)
{
if
(
ret
<
0
||
(
size_t
)
ret
>=
tmplen
)
{
ERROR
(
"Failed to create abstract socket name"
);
ERROR
(
"Failed to create abstract socket name"
);
...
...
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