From 5b18ffbdc1bc2baa7ea286c761c164851f7107a0 Mon Sep 17 00:00:00 2001 From: Tobias Rehbein Date: Tue, 15 Feb 2011 19:25:26 +0100 Subject: [PATCH] Further bugfixes in tools.c Handle zero-sized output buffers gracefully. --- tools.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools.c b/tools.c index f4f07e0..7c697cc 100644 --- a/tools.c +++ b/tools.c @@ -23,6 +23,9 @@ tools_catitems(char *outbuf, size_t outbuflen,...) assert(outbuf != NULL); + if (outbuflen == 0) + return (0); + op = outbuf; ep = op + outbuflen - 1; -- 2.11.4.GIT