From 65807c88861cb1504e54b09426f39cf2d5e4b301 Mon Sep 17 00:00:00 2001 From: schwarze Date: Tue, 18 Apr 2017 13:57:12 +0000 Subject: [PATCH] Fix previous: i forgot explicit NUL termination; noticed by Gonzalo , thanks! --- usr.bin/mandoc/mansearch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 * Copyright (c) 2013-2017 Ingo Schwarze @@ -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; } -- 2.20.1