From ae213537ba0bdc0665d69eae070f5bc030718469 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Thu, 20 Jan 2022 13:01:05 +0100 Subject: [PATCH] utf8: Fix clang null pointer dereference warning --- lib/crypto_backend/utf8.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/crypto_backend/utf8.c b/lib/crypto_backend/utf8.c index 3280c67e..01b96786 100644 --- a/lib/crypto_backend/utf8.c +++ b/lib/crypto_backend/utf8.c @@ -115,6 +115,8 @@ int crypt_utf16_to_utf8(char **out, const char16_t *s, size_t length /* bytes! * char *t; assert(s); + assert(out); + assert(*out); /* Input length is in bytes, i.e. the shortest possible character takes 2 bytes. Each unicode character may * take up to 4 bytes in UTF-8. Let's also account for a trailing NUL byte. */