From: Frank M. Kromann Date: Fri, 28 Oct 2005 19:29:29 +0000 (+0000) Subject: Make sure haystack_len is initialized before it's used X-Git-Tag: RELEASE_2_0_1~131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82c00c179d3981e1a536025899490410a2ce82bc;p=php Make sure haystack_len is initialized before it's used --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 65158ed635..33c88eae30 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2404,6 +2404,7 @@ PHP_FUNCTION(stripos) RETURN_FALSE; } + haystack_len = Z_UNILEN_P(haystack); if (Z_TYPE_P(needle) == IS_UNICODE || Z_TYPE_P(needle) == IS_BINARY || Z_TYPE_P(needle) == IS_STRING) { if (!Z_UNILEN_P(needle)) { RETURN_FALSE; @@ -2418,7 +2419,6 @@ PHP_FUNCTION(stripos) convert_to_explicit_type(needle, str_type); } } - haystack_len = Z_UNILEN_P(haystack); needle_len = Z_UNILEN_P(needle); if (Z_TYPE_P(haystack) == IS_UNICODE) { haystack_dup = eustrndup(Z_USTRVAL_P(haystack), haystack_len);