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; }