]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: fix heap-use-after-free
authorKarel Zak <kzak@redhat.com>
Mon, 6 May 2019 10:39:07 +0000 (12:39 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 6 May 2019 10:39:07 +0000 (12:39 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/787
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/lsblk.c

index 34a6cd9cac7b14f95dab0dcaacc4d9ca7f8ed461..30d5d9b4eaaae67c565942d85c3bba2d4fe46666 100644 (file)
@@ -1560,6 +1560,7 @@ static int process_all_devices(struct lsblk_devtree *tr)
                if (is_maj_excluded(dev->maj) || !is_maj_included(dev->maj)) {
                        DBG(DEV, ul_debug(" %s: ignore (by filter)", d->d_name));
                        lsblk_devtree_remove_device(tr, dev);
+                       dev = NULL;
                        goto next;
                }