summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSylvestre Gallon <syl@cvs.openbsd.org>2013-10-07 18:09:59 +0000
committerSylvestre Gallon <syl@cvs.openbsd.org>2013-10-07 18:09:59 +0000
commit61017cb60447cfb491985dd6f0f488c227114f64 (patch)
treecf7750c0bbd586c369e22f9e3fd5a39e1388830d /sys
parentc761051e93461f572bb3b826d5a941f53a75550a (diff)
Allocate fb_dat in fb_setup(9)
Diffstat (limited to 'sys')
-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);
}