From 8bfecd7e1ec8919cad3c7fe08ef83a2c9cbd1f92 Mon Sep 17 00:00:00 2001 From: Michael Moon Date: Thu, 7 Oct 2021 12:29:53 +0800 Subject: [PATCH] Add a sanity check to id3_ucs4_length. Issue #6 Signed-off-by: Michael Moon --- ucs4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ucs4.c b/ucs4.c index f55f159..9d2e02b 100644 --- a/ucs4.c +++ b/ucs4.c @@ -37,6 +37,9 @@ id3_ucs4_t const id3_ucs4_empty[] = { 0 }; */ id3_length_t id3_ucs4_length(id3_ucs4_t const *ucs4) { + if (!ucs4) + return 0; + id3_ucs4_t const *ptr = ucs4; while (*ptr)