Workaround for Bug 13901
| From: | Andrew Sitnikov | Date: | Sat, 10 Nov 2001 23:32:10 +0000 |
| Subject: | Workaround for Bug 13901 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-70035@lists.php.net to get a copy of this message | ||
Hello php-dev,
I found workaround for 13901 bug, but because i very bad know php internals,
i think php-developers must verify this code:
--cut--
*** string.c.org Sun Nov 11 01:14:08 2001
--- string.c Sun Nov 11 01:12:00 2001
*************** PHPAPI char *php_str_to_str(char *haysta
*** 2143,2148 ****
--- 2143,2157 ----
char *end = haystack + length;
smart_str result = {0};
+ if(!length){
+ smart_str_appendl(&result, "", 0);
+ smart_str_0(&result);
+ if (_new_length) *_new_length = result.len;
+ return result.c;
+ }
+
for (p = haystack;
(r = php_memnstr(p, needle, needle_len, end));
p = r + needle_len) {
--cut--
Best regards,
Andrew Sitnikov
e-mail : sitnikov@infonet.ee
GSM: (+372) 56491109