summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-04-18 13:57:12 +0000
committerschwarze <schwarze@openbsd.org>2017-04-18 13:57:12 +0000
commit65807c88861cb1504e54b09426f39cf2d5e4b301 (patch)
treeb4fe355490da4925383872dabb06de98de2d222e
parentAfter 11 years of pondering about it I think that brookdavis@freebsd.org (diff)
downloadwireguard-openbsd-65807c88861cb1504e54b09426f39cf2d5e4b301.tar.xz
wireguard-openbsd-65807c88861cb1504e54b09426f39cf2d5e4b301.zip
Fix previous: i forgot explicit NUL termination;
noticed by Gonzalo <Tornaria at cmat dot edu dot uy>, thanks!
-rw-r--r--usr.bin/mandoc/mansearch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mandoc/mansearch.c b/usr.bin/mandoc/mansearch.c
index c437b23dc48..e56e758f311 100644
--- a/usr.bin/mandoc/mansearch.c
+++ b/usr.bin/mandoc/mansearch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mansearch.c,v 1.53 2017/04/17 20:04:26 schwarze Exp $ */
+/* $OpenBSD: mansearch.c,v 1.54 2017/04/18 13:57:12 schwarze Exp $ */
/*
* Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013-2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -513,6 +513,8 @@ buildoutput(size_t im, struct dbm_page *page)
output = mandoc_malloc(sz);
i = 0;
lstcat(output, &i, input, " # ");
+ output[i++] = '\0';
+ assert(i == sz);
return output;
}