From 7d79822aa40d626a6ccf5990de2ead7abb5fef0f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 9 Nov 2016 11:54:34 +0100 Subject: [PATCH] fix missing nul-terminator. --- src/util/unicode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/unicode.c b/src/util/unicode.c index dd8e03814..c4dfb40e2 100644 --- a/src/util/unicode.c +++ b/src/util/unicode.c @@ -60,6 +60,10 @@ int unicode_utf8_mkname(utf8_t * op, size_t outlen, const utf8_t * ip) } ip += size; } + if (outlen <= 0) { + return ENOMEM; + } + *op = 0; return 0; }