catch NULLs
authorMichael Wallner <mike@php.net>
Mon, 13 Feb 2012 13:30:26 +0000 (13:30 +0000)
committerMichael Wallner <mike@php.net>
Mon, 13 Feb 2012 13:30:26 +0000 (13:30 +0000)
php_http_misc.c

index 2860caa39a0704e65ca5093d3772bbaeee2dc21d..e4411e0aaf39efb2e654e46913d8287ec0beb001 100644 (file)
@@ -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);