summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjca <jca@openbsd.org>2017-12-14 13:23:30 +0000
committerjca <jca@openbsd.org>2017-12-14 13:23:30 +0000
commit5037151c08a846544f7cc7c5f0834a4a54118279 (patch)
tree3156728f203918dbdf345fb6fb36eb5d92b115c7
parentFree FUSE channel if fuse_new(3) fails in fuse_setup(3). (diff)
downloadwireguard-openbsd-5037151c08a846544f7cc7c5f0834a4a54118279.tar.xz
wireguard-openbsd-5037151c08a846544f7cc7c5f0834a4a54118279.zip
fuse_opt_add_opt_escaped needs to allocate space for the terminating NUL
Spotted by malloc.conf -> S, ok helg@
-rw-r--r--lib/libfuse/fuse_opt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libfuse/fuse_opt.c b/lib/libfuse/fuse_opt.c
index f4bb20428c7..26f86a5cf44 100644
--- a/lib/libfuse/fuse_opt.c
+++ b/lib/libfuse/fuse_opt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_opt.c,v 1.23 2017/12/13 12:23:48 helg Exp $ */
+/* $OpenBSD: fuse_opt.c,v 1.24 2017/12/14 13:23:30 jca Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
* Copyright (c) 2013 Stefan Sperling <stsp@openbsd.org>
@@ -148,6 +148,7 @@ fuse_opt_add_opt_escaped(char **opts, const char *opt)
s++;
size++;
}
+ size++; /* trailing NUL */
if (escaped > 0) {
escaped_opt = malloc(size + escaped);