Check that 'opts' is actually not NULL before dereferencing it. It is expected

that 'opts' will be NULL for the second serial port (-S <slot>,uart)
This commit is contained in:
Neel Natu 2012-08-04 04:24:41 +00:00
parent 90d4b48f60
commit 6459496b69
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/bhyve/; revision=239028

View File

@ -580,7 +580,7 @@ pci_uart_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
pci_emul_alloc_bar(pi, 0, bar, PCIBAR_IO, 8);
pci_lintr_request(pi, ivec);
if (!strcmp("stdio", opts) && !pci_uart_stdio) {
if (opts != NULL && !strcmp("stdio", opts) && !pci_uart_stdio) {
pci_uart_stdio = 1;
sc->stdio = 1;
}