From c0cbc6e7d61f8e5d6cfa7f1c69ee1b5eea64823c Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 19 Mar 2008 17:46:00 +0000 Subject: [PATCH] bmstrcasestr() now returns NULL if either of its supplied arguments is NULL ... instead of passing NULL to strlen() and making the program crash. --- libcitadel/lib/tools.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcitadel/lib/tools.c b/libcitadel/lib/tools.c index 32c96e035..dd630420f 100644 --- a/libcitadel/lib/tools.c +++ b/libcitadel/lib/tools.c @@ -772,6 +772,9 @@ char *bmstrcasestr(char *text, char *pattern) { size_t textlen; size_t patlen; + if (!text) return(NULL); + if (!pattern) return(NULL); + textlen = strlen (text); patlen = strlen (pattern); -- 2.30.2