cvs: php-src /ext/standard string.c
| From: | Frank M. Kromann | Date: | Fri, 28 Oct 2005 19:29:36 +0000 |
| Subject: | cvs: php-src /ext/standard string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-34853@lists.php.net to get a copy of this message | ||
fmk Fri Oct 28 15:29:36 2005 EDT
Modified files:
/php-src/ext/standard string.c
Log:
Make sure haystack_len is initialized before it's used
http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.504&r2=1.505&ty=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.504 php-src/ext/standard/string.c:1.505
--- php-src/ext/standard/string.c:1.504 Mon Oct 24 10:35:02 2005
+++ php-src/ext/standard/string.c Fri Oct 28 15:29:29 2005
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.504 2005/10/24 14:35:02 rolland Exp $ */
+/* $Id: string.c,v 1.505 2005/10/28 19:29:29 fmk Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -2404,6 +2404,7 @@
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 @@
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);