From: Andrey Sokolov Date: Thu, 21 Oct 2021 06:01:07 +0000 (+0300) Subject: fix(install): segfault on popen error X-Git-Tag: 056~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c2f72f152ec319a8001d1ff0bfd1f81a9130b04;p=thirdparty%2Fdracut.git fix(install): segfault on popen error --- diff --git a/src/install/dracut-install.c b/src/install/dracut-install.c index 4ec65a5a5..9a53be158 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;