diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2008-01-07 21:50:33 +1100 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2008-01-07 21:50:33 +1100 |
commit | 832299e099abcf644fb8a7362a9dd18a6a965871 (patch) | |
tree | e368b3c3fc134b9459b36da1325e79889954f155 | |
parent | a57e4ef92b8e590643a325d309511306c5b941a9 (diff) | |
download | talos-petitboot-832299e099abcf644fb8a7362a9dd18a6a965871.tar.gz talos-petitboot-832299e099abcf644fb8a7362a9dd18a6a965871.zip |
Fix check for null initrd and boot args
Because the strings are read from the pb socket, we need to check
for an empty string, not a NULL string.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r-- | devices.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -286,12 +286,12 @@ void pboot_exec_option(void *data) kexec_opts[0] = "/usr/sbin/kexec"; kexec_opts[1] = "-f"; - if (opt->initrd_file) { + if (opt->initrd_file && *opt->initrd_file) { kexec_opts[nr_opts] = malloc(10 + strlen(opt->initrd_file)); sprintf(kexec_opts[nr_opts], "--initrd=%s", opt->initrd_file); nr_opts++; } - if (opt->boot_args) { + if (opt->boot_args && *opt->boot_args) { kexec_opts[nr_opts] = malloc(10 + strlen(opt->boot_args)); sprintf(kexec_opts[nr_opts], "--command-line=%s", opt->boot_args); |