]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
feat(dracut.sh): protect `push_host_devs` function
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Tue, 19 Dec 2023 14:26:17 +0000 (15:26 +0100)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Sun, 31 Mar 2024 22:35:20 +0000 (18:35 -0400)
Check at least that the arguments are not an empty string.

dracut.sh

index 4cf5046d2213e90bd5d328cb94877f6de84126bd..5685a5ea0d2ef5707f24a4cf2c6afad13075533a 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -305,6 +305,7 @@ long_version() {
 push_host_devs() {
     local _dev
     for _dev in "$@"; do
+        [[ -z $_dev ]] && continue
         [[ " ${host_devs[*]} " == *" $_dev "* ]] && return
         host_devs+=("$_dev")
     done