Merge branch 'PHP-7.1' into PHP-7.2

This commit is contained in:
Nikita Popov 2017-07-23 12:21:25 +02:00
commit 88f752a947
4 changed files with 26 additions and 2 deletions

4
NEWS
View file

@ -6,6 +6,10 @@ PHP NEWS
. Fixed bug #74947 (Segfault in scanner on INF number). (Laruence)
. Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
- Mbstring:
. Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding).
(cmb)
- MySQLi:
. Fixed bug #74968 (PHP crashes when calling mysqli_result::fetch_object with
an abstract class). (Anatol)

View file

@ -88,7 +88,8 @@ const struct mbfl_convert_vtbl vtbl_html_wchar = {
mbfl_filt_conv_html_dec_ctor,
mbfl_filt_conv_html_dec_dtor,
mbfl_filt_conv_html_dec,
mbfl_filt_conv_html_dec_flush };
mbfl_filt_conv_html_dec_flush,
mbfl_filt_conv_html_dec_copy };
#define CK(statement) do { if ((statement) < 0) return (-1); } while (0)
@ -309,4 +310,9 @@ int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter)
return err;
}
void mbfl_filt_conv_html_dec_copy(mbfl_convert_filter *src, mbfl_convert_filter *dest)
{
*dest = *src;
dest->opaque = mbfl_malloc(html_enc_buffer_size+1);
memcpy(dest->opaque, src->opaque, html_enc_buffer_size+1);
}

View file

@ -42,6 +42,7 @@ int mbfl_filt_conv_html_enc(int c, mbfl_convert_filter *filter);
int mbfl_filt_conv_html_enc_flush(mbfl_convert_filter *filter);
int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter);
int mbfl_filt_conv_html_dec_flush(mbfl_convert_filter *filter);
void mbfl_filt_conv_html_dec_copy(mbfl_convert_filter *src, mbfl_convert_filter *dest);
void mbfl_filt_conv_html_dec_ctor(mbfl_convert_filter *filter);
void mbfl_filt_conv_html_dec_dtor(mbfl_convert_filter *filter);

View file

@ -0,0 +1,13 @@
--TEST--
Bug #71606 (Segmentation fault mb_strcut + mb_list_encodings)
--SKIPIF--
<?php
if (!extension_loaded('mbstring')) die('skip ext/mbstring not available');
?>
--FILE--
<?php
echo mb_strcut('&quot;', 0, 0, 'HTML-ENTITIES');
echo 'DONE', PHP_EOL;
?>
--EXPECT--
DONE