Skip to content

Commit

Permalink
af_unix: prevent oob writes
Browse files Browse the repository at this point in the history
Fixes: Coverity 1473309
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent 90b9b14 commit 82ba06f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/af_unix.c
Expand Up @@ -218,7 +218,7 @@ static ssize_t lxc_abstract_unix_recv_fds_iov(int fd,
* which exceeds the kernel limit we know about so
* close them and return an error.
*/
if (num_raw > KERNEL_SCM_MAX_FD) {
if (num_raw >= KERNEL_SCM_MAX_FD) {
for (idx = 0; idx < num_raw; idx++)
close(fds_raw[idx]);

Expand Down

0 comments on commit 82ba06f

Please sign in to comment.