From: Michael Tremer Date: Sun, 11 Jul 2021 12:10:48 +0000 (+0000) Subject: stringpool: Do not call strlen() on potential NULL pointer X-Git-Tag: 0.9.8~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1afe55450032484cbdf20302712bda57f444ad21;p=location%2Flibloc.git stringpool: Do not call strlen() on potential NULL pointer Signed-off-by: Michael Tremer --- diff --git a/src/stringpool.c b/src/stringpool.c index cb13179..3e2a2f8 100644 --- a/src/stringpool.c +++ b/src/stringpool.c @@ -208,6 +208,8 @@ LOC_EXPORT struct loc_stringpool* loc_stringpool_unref(struct loc_stringpool* po static off_t loc_stringpool_get_next_offset(struct loc_stringpool* pool, off_t offset) { const char* string = loc_stringpool_get(pool, offset); + if (!string) + return offset; return offset + strlen(string) + 1; }