summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2012-08-04 04:24:41 +0000
committerneel <neel@FreeBSD.org>2012-08-04 04:24:41 +0000
commit9e8084ff867746055e5b7f4290819f36ab3461a3 (patch)
tree801718c51d94656efde03bf24bc3873880fbfb96 /usr.sbin/bhyve
parentf07527ef6066c09742e5ca0ff4631f9c2c68e82d (diff)
downloadFreeBSD-src-9e8084ff867746055e5b7f4290819f36ab3461a3.zip
FreeBSD-src-9e8084ff867746055e5b7f4290819f36ab3461a3.tar.gz
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)
Diffstat (limited to 'usr.sbin/bhyve')
-rw-r--r--usr.sbin/bhyve/pci_uart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/bhyve/pci_uart.c b/usr.sbin/bhyve/pci_uart.c
index 1cb485e..0f8a281 100644
--- a/usr.sbin/bhyve/pci_uart.c
+++ b/usr.sbin/bhyve/pci_uart.c
@@ -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;
}
OpenPOWER on IntegriCloud