]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(install): segfault on popen error
authorAndrey Sokolov <keremet@altlinux.org>
Thu, 21 Oct 2021 06:01:07 +0000 (09:01 +0300)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Tue, 9 Nov 2021 07:01:25 +0000 (07:01 +0000)
src/install/dracut-install.c

index 4ec65a5a5cc4cef6b9793f78465eeb17c2deb403..9a53be158d816b5a5d98f385c0a86d277d3b1ed5 100644 (file)
@@ -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;