From 82c00c179d3981e1a536025899490410a2ce82bc Mon Sep 17 00:00:00 2001 From: "Frank M. Kromann" Date: Fri, 28 Oct 2005 19:29:29 +0000 Subject: [PATCH] Make sure haystack_len is initialized before it's used --- ext/standard/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.40.0