From: schwarze Date: Tue, 18 Apr 2017 13:57:12 +0000 (+0000) Subject: Fix previous: i forgot explicit NUL termination; X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=65807c88861cb1504e54b09426f39cf2d5e4b301;p=openbsd Fix previous: i forgot explicit NUL termination; noticed by Gonzalo , thanks! --- 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; }