From ae61432beb1bf3f3dfa88f7fb4021532352aa6b0 Mon Sep 17 00:00:00 2001 From: avsdev-cw Date: Thu, 8 Oct 2020 15:17:53 +0100 Subject: [PATCH] Handle NULL strings --- src/strext.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/strext.c b/src/strext.c index 53a55b4..31cce4f 100644 --- a/src/strext.c +++ b/src/strext.c @@ -190,6 +190,11 @@ int strbld_str(str_builder *sb, const char *str, size_t len) return 0; } + if (str == 0) { + // NOTE: Should this be a fail? + return 0; + } + if (len == 0) { len = strlen(str); }