mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl: set NULL-termination for the new command line
Let's assume the original `command_line` is 'aaaaaaaaaaaaaaaaaa' and `cextra` is ' =blub'. With the old code this would result in the following new command line: 'blubaaaaaaaaaaaaa' instead of the expected result 'blub\0aaaaaaaaaaaa' Let's fix this by setting the NULL-termination for the new command line. While at it, use the `command_line` variable instead of casting an address. Reviewed-by: Philipp Rudo <prudo@linux.ibm.com> Reviewed-by: Stefan Haberland <sth@linux.ibm.com> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
0ac7ce964e
commit
0c583ec1a6
@@ -204,6 +204,7 @@ void start(void)
|
||||
cextra++;
|
||||
cextra_len--;
|
||||
memcpy(cmdline, cextra, cextra_len);
|
||||
cmdline[cextra_len] = 0;
|
||||
} else if (cmdline_len + 1 <= COMMAND_LINE_SIZE - 1) {
|
||||
/* add blank */
|
||||
cmdline[cmdline_len] = 0x20;
|
||||
|
||||
Reference in New Issue
Block a user