]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
bindings: prevent NULL pointer dereference
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 12 Dec 2018 11:49:16 +0000 (12:49 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 12 Dec 2018 11:49:16 +0000 (12:49 +0100)
Fixes: https://bugs.launchpad.net/ubuntu/+source/lxcfs/+bug/1807628
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
bindings.c

index dba7b793f335238e8808277ff1c3aca8c48cf3ea..097ca81573539f03987568bd5f8c1bcc853c0004 100644 (file)
@@ -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;