From eaf33e4caf3dbd77e89ff7cbbc1afe35c529fe84 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sat, 5 Apr 2025 14:31:15 +0200 Subject: t_sft: fixed null pointer pass to strlen() --- FICS/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'FICS') diff --git a/FICS/utils.c b/FICS/utils.c index 4de322a..fd4e8a6 100644 --- a/FICS/utils.c +++ b/FICS/utils.c @@ -967,7 +967,8 @@ PRIVATE void t_sft(const char *want, struct t_tree *t) { if (t) { - int cmp = strncmp(want ? want : "", t->name, strlen(want)); + const char *v_want = (want ? want : ""); + int cmp = strncmp(v_want, t->name, strlen(v_want)); if (cmp <= 0) // If 'want' <= this one, look left t_sft(want, t->left); -- cgit v1.2.3