PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for ext/pcre/tests/preg_replace_callback.phpt ('preg_replace_callback()')

Script

1: <?php
2: $input 
"plain [indent] deep [indent] [abcd]deeper[/abcd] [/indent] deep [/indent] plain"
3:
4: function 
parseTagsRecursive($input)
5: {
6:     
7:     
$regex '#\[indent]((?:[^[]|\[(?!/?indent])|(?R))+)\[/indent]#';
8:
9:     if (
is_array($input)) {
10:         
$input '<div style="margin-left: 10px">'.$input[1].'</div>';
11:     }
12:
13:     return 
preg_replace_callback($regex'parseTagsRecursive'$input);
14: }
15:
16:
$output parseTagsRecursive($input);
17:
18: echo 
$output"\n";
19:
20:
?>
21:

Report

==9588== Invalid write of size 8
==9588==    at 0x5ADAA0: php_pcre_jit_exec (pcre_jit_compile.c:11572)
==9588==    by 0x5B67BA: php_pcre_replace_func_impl (php_pcre.c:1595)
==9588==    by 0x5B8873: php_pcre_replace_func (php_pcre.c:1732)
==9588==    by 0x5B8873: php_replace_in_subject_func (php_pcre.c:1866)
==9588==    by 0x5B8F2D: preg_replace_func_impl (php_pcre.c:1913)
==9588==    by 0x5BB7E2: zif_preg_replace_callback (php_pcre.c:2076)
==9588==    by 0x11AFBB5: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:618)
==9588==    by 0x133764A: execute_ex (zend_vm_execute.h:59994)
==9588==    by 0x109BEC8: zend_call_function (zend_execute_API.c:791)
==9588==    by 0x5B445C: preg_do_repl_func (php_pcre.c:1203)
==9588==    by 0x5B69EC: php_pcre_replace_func_impl (php_pcre.c:1625)
==9588==    by 0x5B8873: php_pcre_replace_func (php_pcre.c:1732)
==9588==    by 0x5B8873: php_replace_in_subject_func (php_pcre.c:1866)
==9588==    by 0x5B8F2D: preg_replace_func_impl (php_pcre.c:1913)
==9588==  Address 0x1ffeff9e78 is on thread 1's stack
==9588==  3320 bytes below stack pointer
==9588== 

 

Generated at Sun, 12 Nov 2017 21:17:35 +0000 (4 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.