mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
launch: appliance: Fix parsing of QEMU_OPTIONS.
If there was no quoting character, the options could run off the end of the string and into whatever string which happened to be following in memory. This bug was revealed when libguestfs was compiled on arm.
This commit is contained in:
@@ -136,8 +136,12 @@ add_cmdline_shell_unquoted (guestfs_h *g, const char *options)
|
||||
endp = options + strlen (options);
|
||||
}
|
||||
|
||||
if (quote == ' ')
|
||||
nextp = endp+1;
|
||||
if (quote == ' ') {
|
||||
if (endp[0] == '\0')
|
||||
nextp = endp;
|
||||
else
|
||||
nextp = endp+1;
|
||||
}
|
||||
else {
|
||||
if (!endp[1])
|
||||
nextp = endp+1;
|
||||
|
||||
Reference in New Issue
Block a user