From 84269037b75de93bdd4ea75b7f50ba77ba976377 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 12 May 2020 00:26:28 +0100 Subject: [PATCH] blockd: fix segfault triggered by non-autofs mounts Program received signal SIGSEGV, Segmentation fault. main_autofs (argv=, argc=) at fstools-2020-05-06-eec16e2f/block.c:1193 1193: if (!m->autofs && (mp = find_mount_point(pr->dev))) { Fixes: 9ab936d ("block(d): always call hotplug.d "mount" scripts from blockd") Signed-off-by: Daniel Golle --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index 9458d52..569bf56 100644 --- a/block.c +++ b/block.c @@ -1190,7 +1190,7 @@ static int main_autofs(int argc, char **argv) continue; blockd_notify("hotplug", pr->dev, m, pr); - if (!m->autofs && (mp = find_mount_point(pr->dev))) { + if ((!m || !m->autofs) && (mp = find_mount_point(pr->dev))) { blockd_notify("mount", pr->dev, NULL, NULL); free(mp); } -- 2.25.1