mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 15:01:57 +00:00
commands: add additional check to lxc_cmd_sock_get_state()
to please Coverity. Fixes: Coverity 1461732. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
c148bb7d9f
commit
7792a5b60f
@ -62,11 +62,14 @@ int lxc_cmd_sock_get_state(const char *name, const char *lxcpath,
|
||||
|
||||
ret = lxc_cmd_add_state_client(name, lxcpath, states, &state_client_fd);
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
return ret_errno(EINVAL);
|
||||
|
||||
if (ret < MAX_STATE)
|
||||
return ret;
|
||||
|
||||
if (state_client_fd < 0)
|
||||
return ret_errno(EBADF);
|
||||
|
||||
return lxc_cmd_sock_rcv_state(state_client_fd, timeout);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user