svn commit: r239028 - projects/bhyve/usr.sbin/bhyve

Neel Natu neel at FreeBSD.org
Sat Aug 4 04:24:42 UTC 2012


Author: neel
Date: Sat Aug  4 04:24:41 2012
New Revision: 239028
URL: http://svn.freebsd.org/changeset/base/239028

Log:
  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)

Modified:
  projects/bhyve/usr.sbin/bhyve/pci_uart.c

Modified: projects/bhyve/usr.sbin/bhyve/pci_uart.c
==============================================================================
--- projects/bhyve/usr.sbin/bhyve/pci_uart.c	Sat Aug  4 03:05:01 2012	(r239027)
+++ projects/bhyve/usr.sbin/bhyve/pci_uart.c	Sat Aug  4 04:24:41 2012	(r239028)
@@ -580,7 +580,7 @@ pci_uart_init(struct vmctx *ctx, struct 
 	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;
 	}


More information about the svn-src-projects mailing list