From 5c2f72f152ec319a8001d1ff0bfd1f81a9130b04 Mon Sep 17 00:00:00 2001 From: Andrey Sokolov Date: Thu, 21 Oct 2021 09:01:07 +0300 Subject: [PATCH] fix(install): segfault on popen error --- src/install/dracut-install.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c index 4ec65a5a5c..9a53be158d 100644 --- a/src/install/dracut-install.c +++ b/src/install/dracut-install.c @@ -550,6 +550,10 @@ static int resolve_deps(const char *src) ret = 0; fptr = popen(cmd, "r"); + if (fptr == NULL) { + log_error("Error '%s' initiating pipe stream from '%s'", strerror(errno), cmd); + exit(EXIT_FAILURE); + } while (!feof(fptr)) { char *p;