Skip to content

Commit 608decf

Browse files
author
Yasuo Ohgaki
committed
Merge branch 'PHP-7.1' of git.php.net:php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:php-src: (53 commits) Fix bug #72785 - allowed_classes only applies to outermost unserialize() Fix #70752: Depacking with wrong password leaves 0 length files Unbreak FAST_ZPP dead code Updated NEWS Fixes #72590: Opcache restart with kill_all_lockers does not work Limit editorconfig to C code Updated NEWS Updated NEWS Updated NEWS Fix #72972, Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and FILTER_FLAG_NO_PRIV_RANGE Change the name of the second parameter of image writer functions Added editorconfig file Implement #47456: Missing PCRE option 'J' Use integer placeholders, since values can vary with the TDS version phpdbg: couple of network function return checks. Possible overflow when copy the socket_path configuration. Same issue as #72926 in another place. Sync fix for bug #72910 with current upstream Fix #72994: mbc_to_code() out of bounds read Bump PHP_API_VERSION Fix bug #72996 ...
2 parents 4f07f0e + 747d21c commit 608decf

File tree

87 files changed

+871
-334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+871
-334
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; http://editorconfig.org/
2+
3+
root = true
4+
5+
[*.{c,h}]
6+
charset = UTF-8
7+
end_of_line = LF
8+
indent_size = 4
9+
indent_style = tab
10+
insert_final_newline = true
11+
tab_width = 4
12+
trim_trailing_whitespace = true
13+
14+
[*.yml]
15+
indent_size = 2
16+
indent_style = space

NEWS

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,20 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2016, PHP 7.1.0RC2
44

5+
- Filter:
6+
. Fixed bug #72972 (Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and
7+
FILTER_FLAG_NO_PRIV_RANGE). (julien)
8+
9+
-GD:
10+
. Fixed bug #67325 (imagetruecolortopalette: white is duplicated in palette).
11+
(cmb)
512

13+
- Opcache:
14+
. Fixed bug #72982 (Memory leak in zend_accel_blacklist_update_regexp()
15+
function). (Laruence)
16+
17+
- SQLite3:
18+
. Updated to SQLite3 3.14.1. (cmb)
619

720
01 Sep 2016, PHP 7.1.0RC1
821

UPGRADING

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PHP 7.1 UPGRADE NOTES
6161
. Fixes to random number generators mean that mt_rand() now produces a
6262
different sequence of outputs to previous versions. If you relied on
6363
mt_srand() to produce a deterministic sequence, it can be called using
64-
mt_srand($seed, MT_RAND_PHP) to produce old the sequences.
64+
mt_srand($seed, MT_RAND_PHP) to produce the old sequences.
6565
. URL rewriter has been improved.
6666
. Use dedicated buffer for Session module rewrite and User rewrite.
6767
. Full path URL rewrite is supported. Allowed domain can be specified.
@@ -103,7 +103,7 @@ PHP 7.1 UPGRADE NOTES
103103
. session.entropy_length
104104
. New INIs and defaults
105105
. session.sid_length (Number of session ID characters - 22 to 256.
106-
(php.ini-* default: 26 Compitled default: 32)
106+
(php.ini-* default: 26 Compiled default: 32)
107107
. session.sid_bits_per_character (Bits used per character. 4 to 6.
108108
php.ini-* default: 5 Compiled default: 4)
109109
Length of old session ID string is determined as follows
@@ -122,7 +122,7 @@ PHP 7.1 UPGRADE NOTES
122122

123123
- Reflection:
124124
. The behavior of ReflectionMethod::invoke() and ::invokeArgs() has been
125-
aligned, what causes slightly different behavior than before for some
125+
aligned, which causes slightly different behavior than before for some
126126
pathological cases.
127127
. ReflectionType::__toString() will now return the type name with a leading
128128
"?" if it is nullable. To retrieve the type name without leading "?" the new
@@ -268,7 +268,7 @@ PHP 7.1 UPGRADE NOTES
268268

269269
- DBA:
270270
. Data modification functions (e.g.: dba_insert()) now throw an instance of
271-
Error instead of triggering a catchable fatal error if the key is does not
271+
Error instead of triggering a catchable fatal error if the key does not
272272
contain exactly two elements.
273273

274274
- DOM:

Zend/zend_API.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2911,7 +2911,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
29112911
zend_string *mname, *cname;
29122912
zend_string *lmname;
29132913
const char *colon;
2914-
size_t clen, mlen;
2914+
size_t clen;
29152915
HashTable *ftable;
29162916
int call_via_handler = 0;
29172917
zend_class_entry *scope;
@@ -2964,6 +2964,8 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
29642964
colon > Z_STRVAL_P(callable) &&
29652965
*(colon-1) == ':'
29662966
) {
2967+
size_t mlen;
2968+
29672969
colon--;
29682970
clen = colon - Z_STRVAL_P(callable);
29692971
mlen = Z_STRLEN_P(callable) - clen - 2;
@@ -2996,7 +2998,6 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
29962998
mname = zend_string_init(Z_STRVAL_P(callable) + clen + 2, mlen, 0);
29972999
} else if (ce_org) {
29983000
/* Try to fetch find static method of given class. */
2999-
mlen = Z_STRLEN_P(callable);
30003001
mname = Z_STR_P(callable);
30013002
zend_string_addref(mname);
30023003
ftable = &ce_org->function_table;

Zend/zend_virtual_cwd.c

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -328,32 +328,19 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
328328
buf->st_dev = buf->st_rdev = 0;
329329
} else {
330330
wchar_t cur_path[MAXPATHLEN+1];
331-
DWORD len = sizeof(cur_path);
332-
wchar_t *tmp = cur_path;
333-
334-
while(1) {
335-
DWORD r = GetCurrentDirectoryW(len, tmp);
336-
if (r < len) {
337-
if (tmp[1] == L':') {
338-
if (pathw[0] >= L'A' && pathw[0] <= L'Z') {
339-
buf->st_dev = buf->st_rdev = pathw[0] - L'A';
340-
} else {
341-
buf->st_dev = buf->st_rdev = pathw[0] - L'a';
342-
}
331+
332+
if (NULL != _wgetcwd(cur_path, sizeof(cur_path)/sizeof(wchar_t))) {
333+
if (cur_path[1] == L':') {
334+
if (pathw[0] >= L'A' && pathw[0] <= L'Z') {
335+
buf->st_dev = buf->st_rdev = pathw[0] - L'A';
343336
} else {
344-
buf->st_dev = buf->st_rdev = -1;
337+
buf->st_dev = buf->st_rdev = pathw[0] - L'a';
345338
}
346-
break;
347-
} else if (!r) {
348-
buf->st_dev = buf->st_rdev = -1;
349-
break;
350339
} else {
351-
len = r+1;
352-
tmp = (wchar_t*)malloc(len*sizeof(wchar_t));
340+
buf->st_dev = buf->st_rdev = -1;
353341
}
354-
}
355-
if (tmp != cur_path) {
356-
free(tmp);
342+
} else {
343+
buf->st_dev = buf->st_rdev = -1;
357344
}
358345
}
359346

@@ -934,7 +921,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
934921
wchar_t * reparsetarget;
935922
BOOL isVolume = FALSE;
936923
char *printname = NULL, *substitutename = NULL;
937-
int printname_len, substitutename_len;
924+
int substitutename_len;
938925
int substitutename_off = 0;
939926

940927
if(++(*ll) > LINK_MAX) {
@@ -969,7 +956,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
969956

970957
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
971958
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
972-
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
973959
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
974960
printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR));
975961
if (!printname) {
@@ -992,7 +978,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
992978
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
993979
isabsolute = 1;
994980
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
995-
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
996981
printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR));
997982
if (!printname) {
998983
free_alloca(pbuffer, use_heap_large);

ext/exif/exif.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3724,8 +3724,11 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
37243724
fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
37253725
if (fgot < ImageInfo->Thumbnail.size) {
37263726
EXIF_ERRLOG_THUMBEOF(ImageInfo)
3727+
efree(ImageInfo->Thumbnail.data);
3728+
ImageInfo->Thumbnail.data = NULL;
3729+
} else {
3730+
exif_thumbnail_build(ImageInfo);
37273731
}
3728-
exif_thumbnail_build(ImageInfo);
37293732
}
37303733
}
37313734
}

ext/filter/logical_filters.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
789789
if (flags & FILTER_FLAG_NO_PRIV_RANGE) {
790790
if (
791791
(ip[0] == 10) ||
792-
(ip[0] == 169 && ip[1] == 254) ||
793-
(ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) ||
792+
(ip[0] == 172 && ip[1] >= 16 && ip[1] <= 31) ||
794793
(ip[0] == 192 && ip[1] == 168)
795794
) {
796795
RETURN_VALIDATION_FAILED
@@ -800,19 +799,9 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
800799
if (flags & FILTER_FLAG_NO_RES_RANGE) {
801800
if (
802801
(ip[0] == 0) ||
803-
(ip[0] == 10) ||
804-
(ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) ||
802+
(ip[0] >= 240) ||
805803
(ip[0] == 127) ||
806-
(ip[0] == 169 && ip[1] == 254) ||
807-
(ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) ||
808-
(ip[0] == 192 && ip[1] == 0 && ip[2] == 0) ||
809-
(ip[0] == 192 && ip[1] == 0 && ip[2] == 2) ||
810-
(ip[0] == 192 && ip[1] == 88 && ip[2] == 99) ||
811-
(ip[0] == 192 && ip[1] == 168) ||
812-
(ip[0] == 198 && (ip[1] == 18 || ip[1] == 19)) ||
813-
(ip[0] == 198 && ip[1] == 51 && ip[2] == 100) ||
814-
(ip[0] == 203 && ip[1] == 0 && ip[2] == 113) ||
815-
(ip[0] >= 224 && ip[0] <= 255)
804+
(ip[0] == 169 && ip[1] == 254)
816805
) {
817806
RETURN_VALIDATION_FAILED
818807
}

ext/filter/tests/018.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ string(9) "127.0.0.1"
4141
bool(false)
4242
string(12) "192.0.34.166"
4343
bool(false)
44-
bool(false)
45-
bool(false)
46-
bool(false)
44+
string(9) "192.0.0.1"
45+
string(10) "100.64.0.0"
46+
string(15) "100.127.255.255"
4747
string(12) "192.0.34.166"
4848
bool(false)
4949
string(15) "255.255.255.255"

ext/filter/tests/filter_ipv4_rfc6890.phpt

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ string(10) "10.0.0.0/8"
8585
bool(false)
8686
bool(false)
8787
string(14) "168.254.0.0/16"
88-
bool(false)
89-
bool(false)
88+
string(11) "169.254.0.0"
89+
string(15) "169.254.255.255"
9090
string(13) "172.16.0.0/12"
9191
bool(false)
9292
bool(false)
@@ -97,44 +97,44 @@ string(9) "0.0.0.0/8"
9797
bool(false)
9898
bool(false)
9999
string(10) "10.0.0.0/8"
100-
bool(false)
101-
bool(false)
100+
string(8) "10.0.0.0"
101+
string(14) "10.255.255.255"
102102
string(12) "10.64.0.0/10"
103-
bool(false)
104-
bool(false)
103+
string(10) "100.64.0.0"
104+
string(15) "100.127.255.255"
105105
string(11) "127.0.0.0/8"
106106
bool(false)
107107
bool(false)
108108
string(14) "169.254.0.0/16"
109109
bool(false)
110110
bool(false)
111111
string(13) "172.16.0.0/12"
112-
bool(false)
113-
bool(false)
112+
string(10) "172.16.0.0"
113+
string(10) "172.31.0.0"
114114
string(12) "192.0.0.0/24"
115-
bool(false)
116-
bool(false)
115+
string(9) "192.0.0.0"
116+
string(11) "192.0.0.255"
117117
string(12) "192.0.0.0/29"
118-
bool(false)
119-
bool(false)
118+
string(9) "192.0.0.0"
119+
string(9) "192.0.0.7"
120120
string(12) "192.0.2.0/24"
121-
bool(false)
122-
bool(false)
121+
string(9) "192.0.2.0"
122+
string(11) "192.0.2.255"
123123
string(13) "198.18.0.0/15"
124-
bool(false)
125-
bool(false)
124+
string(10) "198.18.0.0"
125+
string(14) "198.19.255.255"
126126
string(15) "198.51.100.0/24"
127-
bool(false)
128-
bool(false)
127+
string(12) "198.51.100.0"
128+
string(14) "198.51.100.255"
129129
string(14) "192.88.99.0/24"
130-
bool(false)
131-
bool(false)
130+
string(11) "192.88.99.0"
131+
string(13) "192.88.99.255"
132132
string(14) "192.168.0.0/16"
133-
bool(false)
134-
bool(false)
133+
string(11) "192.168.0.0"
134+
string(15) "192.168.255.255"
135135
string(14) "203.0.113.0/24"
136-
bool(false)
137-
bool(false)
136+
string(11) "203.0.113.0"
137+
string(13) "203.0.113.255"
138138
string(11) "240.0.0.0/4"
139-
bool(false)
139+
string(9) "224.0.0.0"
140140
bool(false)

0 commit comments

Comments
 (0)