Fix preg_replace with /e not to segfault
commit6f96374082d8fa7dac74431e133ecbde456096a4
authorEmil Hesslow <emil@fb.com>
Tue, 18 Feb 2014 23:11:23 +0000 (18 15:11 -0800)
committerSara Golemon <sgolemon@fb.com>
Fri, 21 Feb 2014 00:25:00 +0000 (20 16:25 -0800)
treef5f817ea868dc4e81a2e24bab7087ad5758c57e9
parent010c826b9b6bea91b8be123801643fcdac0b214e
Fix preg_replace with /e not to segfault

- When running with /e and the result was bigger than the buffer we segfaulted

Fixes #1810

Reviewed By: @ptarjan

Differential Revision: D1176864
hphp/runtime/base/preg.cpp
hphp/test/slow/ext_preg/ext_preg_e.php
hphp/test/slow/ext_preg/ext_preg_e.php.expectf
hphp/test/slow/ext_preg/preg_replace_callback.php [new file with mode: 0644]
hphp/test/slow/ext_preg/preg_replace_callback.php.expectf [new file with mode: 0644]