From c5d73e37bbc0c9fa8fd1dd874ac782b655068576 Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 19 Nov 2019 11:16:17 -0800 Subject: [PATCH] Fix strcasestr SIGSEGV in the case of only upper case strchr returning NULL --- src/strcasestr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strcasestr.c b/src/strcasestr.c index 2077dc3ff..86c7ec5b0 100644 --- a/src/strcasestr.c +++ b/src/strcasestr.c @@ -75,7 +75,7 @@ strcasestr (const char *s, const char *q) if (!( (intptr_t)up|(intptr_t)lp )) return 0; - if (!lp || up < lp) + if (!lp || ( up && up < lp )) { ppa = &up; ppb = &lp;