Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Apr 2021 14:46:20 GMT
From:      Roman Bogorodskiy <novel@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f2ecc0d1b7d5 - main - bhyve: fix regression in legacy virtio-9p config parsing
Message-ID:  <202104081446.138EkKus071121@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by novel (ports committer):

URL: https://cgit.FreeBSD.org/src/commit/?id=f2ecc0d1b7d569b4b2c930c7450390c04778ee8a

commit f2ecc0d1b7d569b4b2c930c7450390c04778ee8a
Author:     Roman Bogorodskiy <novel@FreeBSD.org>
AuthorDate: 2021-04-08 14:44:58 +0000
Commit:     Roman Bogorodskiy <novel@FreeBSD.org>
CommitDate: 2021-04-08 14:44:58 +0000

    bhyve: fix regression in legacy virtio-9p config parsing
    
    Commit 621b5090487de9fed1b503769702a9a2a27cc7bb introduced a regression
    in legacy virtio-9p config parsing by not initializing *sharename to
    NULL. As a result, "sharename != NULL" check in the first iteration fails
    and bhyve exits with "virtio-9p: more than one share name given".
    
    Fix by adding NULL back.
    
    Approved by:    grehan
---
 usr.sbin/bhyve/pci_virtio_9p.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/pci_virtio_9p.c b/usr.sbin/bhyve/pci_virtio_9p.c
index fed18ce5a8cc..f96d53858225 100644
--- a/usr.sbin/bhyve/pci_virtio_9p.c
+++ b/usr.sbin/bhyve/pci_virtio_9p.c
@@ -224,7 +224,7 @@ pci_vt9p_notify(void *vsc, struct vqueue_info *vq)
 static int
 pci_vt9p_legacy_config(nvlist_t *nvl, const char *opts)
 {
-	char *sharename, *tofree, *token, *tokens;
+	char *sharename = NULL, *tofree, *token, *tokens;
 
 	if (opts == NULL)
 		return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104081446.138EkKus071121>