From 39a291bc538a95f650811b08d91056b8353ed81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 2 Jun 2018 15:14:21 +0200 Subject: [PATCH] core: return NULL in function string_cut if string is NULL --- src/core/wee-string.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/wee-string.c b/src/core/wee-string.c index 0bdb2f356..4a2955396 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -112,6 +112,9 @@ string_cut (const char *string, int length, int count_suffix, int screen, char *result; const char *ptr_string; + if (!string) + return NULL; + if (screen) ptr_string = gui_chat_string_add_offset_screen (string, length); else