From: Michael Wallner Date: Mon, 13 Feb 2012 13:30:26 +0000 (+0000) Subject: catch NULLs X-Git-Tag: DEV_2-before-client~40 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=94b41df5ff58a07118a24d935371b241e53d2669;p=m6w6%2Fext-http catch NULLs --- 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);