[lxc-devel] [lxcfs/master] bindings: prevent NULL pointer dereference

brauner on Github lxc-bot at linuxcontainers.org
Wed Dec 12 11:51:05 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 434 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181212/6de3ec65/attachment.bin>
-------------- next part --------------
From b737a54afa1a53140d693018561be3ff163b10a1 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Wed, 12 Dec 2018 12:49:16 +0100
Subject: [PATCH] bindings: prevent NULL pointer dereference

Fixes: https://bugs.launchpad.net/ubuntu/+source/lxcfs/+bug/1807628
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 bindings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bindings.c b/bindings.c
index dba7b79..097ca81 100644
--- a/bindings.c
+++ b/bindings.c
@@ -2136,7 +2136,7 @@ int cg_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset
 		goto out;
 	}
 
-	for (i = 0; list[i]; i++) {
+	for (i = 0; list && list[i]; i++) {
 		if (filler(buf, list[i]->name, NULL, 0) != 0) {
 			ret = -EIO;
 			goto out;


More information about the lxc-devel mailing list