From 917f7aa880a7c6ab08991ae0c969d0489ba48845 Mon Sep 17 00:00:00 2001 From: Brandon Bergren Date: Sun, 10 Jun 2018 13:21:58 -0500 Subject: Fix pb-discover segfaults caused by list corruption. I was seeing list corruption and segfaults in pb-discover on my Talos II when using both yaboot and kboot config files on the same device. My assumption is that discover_context_add_boot_option() was being called on the same pointer more than once. So, null the pointer right after the call. The ownership was transferred anyway so the parsers should not keep it around. Signed-off-by: Brandon Bergren Signed-off-by: Samuel Mendoza-Jonas --- discover/syslinux-parser.c | 1 + 1 file changed, 1 insertion(+) (limited to 'discover/syslinux-parser.c') diff --git a/discover/syslinux-parser.c b/discover/syslinux-parser.c index be7b94a..c611ac9 100644 --- a/discover/syslinux-parser.c +++ b/discover/syslinux-parser.c @@ -408,6 +408,7 @@ static void syslinux_finalize(struct conf_context *conf) conf_strip_str(opt->description); discover_context_add_boot_option(dc, d_opt); + d_opt = NULL; continue; fail: -- cgit v1.2.1