The previous commit introduced an error where
console could potentially be accessed while
NULL.
This commit addresses that problem.
}
free (state->kernel_console_tty);
+ state->kernel_console_tty = NULL;
- if (strcmp (console, "tty0") == 0 || strcmp (console, "/dev/tty0") == 0)
- state->kernel_console_tty = strdup (default_tty);
- else
- state->kernel_console_tty = strdup (console);
+ if (console != NULL)
+ {
+ if (strcmp (console, "tty0") == 0 || strcmp (console, "/dev/tty0") == 0)
+ state->kernel_console_tty = strdup (default_tty);
+ else
+ state->kernel_console_tty = strdup (console);
+ }
if (should_add_displays)
{