git: f2ecc0d1b7d5 - main - bhyve: fix regression in legacy virtio-9p config parsing
Roman Bogorodskiy
novel at FreeBSD.org
Thu Apr 8 14:46:21 UTC 2021
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 at FreeBSD.org>
AuthorDate: 2021-04-08 14:44:58 +0000
Commit: Roman Bogorodskiy <novel at 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);
More information about the dev-commits-src-main
mailing list