From 94b41df5ff58a07118a24d935371b241e53d2669 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 13 Feb 2012 13:30:26 +0000 Subject: [PATCH] catch NULLs --- php_http_misc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php_http_misc.c b/php_http_misc.c index 2860caa..e4411e0 100644 --- a/php_http_misc.c +++ b/php_http_misc.c @@ -50,6 +50,10 @@ int php_http_match(const char *haystack_str, const char *needle_str, int flags) { int result = 0; + if (!haystack_str || !needle_str) { + return result; + } + if (flags & PHP_HTTP_MATCH_FULL) { if (flags & PHP_HTTP_MATCH_CASE) { result = !strcmp(haystack_str, needle_str); -- 2.30.2