commands: ensure that non-NULL and MAX_STATE is always passed

parent 8b1e889b
...@@ -1280,7 +1280,7 @@ static int lxc_cmd_get_lxcpath_callback(int fd, struct lxc_cmd_req *req, ...@@ -1280,7 +1280,7 @@ static int lxc_cmd_get_lxcpath_callback(int fd, struct lxc_cmd_req *req,
} }
int lxc_cmd_add_state_client(const char *name, const char *lxcpath, int lxc_cmd_add_state_client(const char *name, const char *lxcpath,
lxc_state_t states[MAX_STATE], lxc_state_t states[static MAX_STATE],
int *state_client_fd) int *state_client_fd)
{ {
__do_close int clientfd = -EBADF; __do_close int clientfd = -EBADF;
......
...@@ -112,8 +112,10 @@ __hidden extern int lxc_cmd_stop(const char *name, const char *lxcpath); ...@@ -112,8 +112,10 @@ __hidden extern int lxc_cmd_stop(const char *name, const char *lxcpath);
* via socket fd * via socket fd
* < MAX_STATE current container state * < MAX_STATE current container state
*/ */
__hidden extern int lxc_cmd_add_state_client(const char *name, const char *lxcpath, __hidden __access_r_nosize(3) extern int lxc_cmd_add_state_client(const char *name,
lxc_state_t states[MAX_STATE], int *state_client_fd); const char *lxcpath,
lxc_state_t states[static MAX_STATE],
int *state_client_fd);
__hidden extern int lxc_cmd_serve_state_clients(const char *name, const char *lxcpath, __hidden extern int lxc_cmd_serve_state_clients(const char *name, const char *lxcpath,
lxc_state_t state); lxc_state_t state);
......
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#define __cgfsng_ops #define __cgfsng_ops
/* access attribute */ /* access attribute */
#define __access_r_nosize(x)
#define __access_r(x, y) #define __access_r(x, y)
#define __access_w(x, y) #define __access_w(x, y)
#define __access_rw(x, y) #define __access_rw(x, y)
...@@ -69,6 +70,9 @@ ...@@ -69,6 +70,9 @@
#undef __access_r #undef __access_r
#define __access_r(x, y) __attribute__((access(read_only, x, y))) #define __access_r(x, y) __attribute__((access(read_only, x, y)))
#undef __access_r_nosize
#define __access_r_nosize(x) __attribute__((access(read_only, x)))
#undef __access_w #undef __access_w
#define __access_w(x, y) __attribute__((access(write_only, x, y))) #define __access_w(x, y) __attribute__((access(write_only, x, y)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment