From 61017cb60447cfb491985dd6f0f488c227114f64 Mon Sep 17 00:00:00 2001 From: Sylvestre Gallon Date: Mon, 7 Oct 2013 18:09:59 +0000 Subject: Allocate fb_dat in fb_setup(9) --- sys/miscfs/fuse/fusebuf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/miscfs') 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 * @@ -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); } -- cgit v1.2.3