Unverified Commit 71fc9c04 by Rachid Koucha Committed by GitHub

Avoid risk of "too far memory read"

As we call "lxc_add_state_client(fd, handler, (lxc_state_t *)req->data)" which supposes that the last parameter is a table of MAX_STATE entries when calling memcpy(): memcpy(newclient->states, states, sizeof(newclient->states)) Signed-off-by: 's avatarRachid Koucha <rachid.koucha@gmail.com>
parent 81f22990
......@@ -896,7 +896,7 @@ static int lxc_cmd_add_state_client_callback(int fd, struct lxc_cmd_req *req,
if (req->datalen < 0)
goto reap_client_fd;
if (req->datalen > (sizeof(lxc_state_t) * MAX_STATE))
if (req->datalen != (sizeof(lxc_state_t) * MAX_STATE))
goto reap_client_fd;
if (!req->data)
......
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