Unverified Commit 00d87eb1 by Christian Brauner Committed by Stéphane Graber

commands: add additional check to lxc_cmd_sock_get_state()

to please Coverity. Fixes: Coverity 1461732. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent a1232a57
......@@ -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);
}
......
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