emulators/virtualbox-ose-additions: Assign default value to pointer

In the virtualbox virtual filesystem code we ship as a patch some
code in an else block is commented out. This produces a code path
in which a pointer variable is dereferenced in an unassigned state,
causing random crashes.

Lacking a better fix, give a default value of NULL to the pointer,
which at least avoids the random pointer dereference issue.

PR:		255386
This commit is contained in:
Martin Ilavsky 2021-09-11 22:38:50 +02:00 committed by Guido Falsi
parent 67b637822a
commit 1b2394551c
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= virtualbox-ose
PORTVERSION= 6.1.26
PORTREVISION= 1
CATEGORIES= emulators
MASTER_SITES= https://download.virtualbox.org/virtualbox/${PORTVERSION}/
PKGNAMESUFFIX?= -additions

View File

@ -1,4 +1,4 @@
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2021-01-07 15:34:22 UTC
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2021-07-28 16:16:27 UTC
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c
@@ -14,228 +14,1350 @@
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
@ -1119,7 +1119,7 @@
+ struct vnode *vp = ap->a_vp;
+ struct uio *uio = ap->a_uio;
+ struct vboxfs_node *dir = VP_TO_VBOXFS_NODE(vp);
+ struct vboxfs_node *node;
+ struct vboxfs_node *node = NULL;
+ struct sffs_dirent *dirent = NULL;
+ sffs_dirents_t *cur_buf;
+ off_t offset = 0;