diff options
-rw-r--r-- | kexec/arch/i386/kexec-bzImage.c | 3 | ||||
-rw-r--r-- | kexec/arch/i386/kexec-elf-x86.c | 3 | ||||
-rw-r--r-- | kexec/arch/x86_64/kexec-bzImage64.c | 6 |
3 files changed, 11 insertions, 1 deletions
diff --git a/kexec/arch/i386/kexec-bzImage.c b/kexec/arch/i386/kexec-bzImage.c index 39452a4..9680048 100644 --- a/kexec/arch/i386/kexec-bzImage.c +++ b/kexec/arch/i386/kexec-bzImage.c @@ -439,6 +439,9 @@ int bzImage_load(int argc, char **argv, const char *buf, off_t len, command_line_len = 0; if (command_line) { command_line_len = strlen(command_line) +1; + } else { + command_line = strdup("\0"); + command_line_len = 1; } ramdisk_buf = 0; if (ramdisk) { diff --git a/kexec/arch/i386/kexec-elf-x86.c b/kexec/arch/i386/kexec-elf-x86.c index 94571ca..9751a76 100644 --- a/kexec/arch/i386/kexec-elf-x86.c +++ b/kexec/arch/i386/kexec-elf-x86.c @@ -167,6 +167,9 @@ int elf_x86_load(int argc, char **argv, const char *buf, off_t len, command_line_len = 0; if (command_line) { command_line_len = strlen(command_line) +1; + } else { + command_line = strdup("\0"); + command_line_len = 1; } /* Need to append some command line parameters internally in case of diff --git a/kexec/arch/x86_64/kexec-bzImage64.c b/kexec/arch/x86_64/kexec-bzImage64.c index 21bc4ae..01bd9d9 100644 --- a/kexec/arch/x86_64/kexec-bzImage64.c +++ b/kexec/arch/x86_64/kexec-bzImage64.c @@ -286,8 +286,12 @@ int bzImage64_load(int argc, char **argv, const char *buf, off_t len, if (tmp_cmdline) free(tmp_cmdline); command_line_len = 0; - if (command_line) + if (command_line) { command_line_len = strlen(command_line) + 1; + } else { + command_line = strdup("\0"); + command_line_len = 1; + } ramdisk_buf = 0; if (ramdisk) ramdisk_buf = slurp_file(ramdisk, &ramdisk_length); |