summaryrefslogtreecommitdiff
path: root/sys/miscfs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/fuse/fusebuf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/miscfs/fuse/fusebuf.c b/sys/miscfs/fuse/fusebuf.c
index 4c9aae7b6e7..c387cfdaa12 100644
--- a/sys/miscfs/fuse/fusebuf.c
+++ b/sys/miscfs/fuse/fusebuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fusebuf.c,v 1.3 2013/10/07 18:04:53 syl Exp $ */
+/* $OpenBSD: fusebuf.c,v 1.4 2013/10/07 18:09:58 syl Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -41,6 +41,11 @@ fb_setup(size_t len, ino_t ino, int op, struct proc *p)
fbuf->fb_uuid = arc4random();
fbuf->fb_type = op;
fbuf->fb_ino = ino;
+ if (len == 0)
+ fbuf->fb_dat = NULL;
+ else
+ fbuf->fb_dat = (uint8_t *)malloc(len, M_FUSEFS,
+ M_WAITOK | M_ZERO);
return (fbuf);
}