Skip to content

Commit 1e081a8

Browse files
committed
Merge branch 'PHP-5.3' of git.php.net:/php-src into PHP-5.3
2 parents 1784279 + bb60122 commit 1e081a8

File tree

18 files changed

+225
-24
lines changed

18 files changed

+225
-24
lines changed

NEWS

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,32 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
?? ??? 2ß12, PHP 5.3.20
4+
5+
- Core:
6+
. Fixed bug #63451 (config.guess file does not have AIX 7 defined,
7+
shared objects are not created). (kemcline at au1 dot ibm dot com)
8+
39
?? ??? 2012, PHP 5.3.19
410

11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
ADD NEWS ONLY ABOVE IN 5.3.20 SECTION
13+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14+
RM will merge 5.3.19 entries when merging to release branch
15+
16+
- Core
17+
. Fixed bug #63241 (PHP fails to open Windows deduplicated files).
18+
(daniel dot stelter-gliese at innogames dot de)
19+
. Fixed bug #62444 (Handle leak in is_readable on windows).
20+
(krazyest at seznam dot cz)
21+
22+
- Libxml
23+
. Fixed bug #63389 (Missing context check on libxml_set_streams_context()
24+
causes memleak). (Laruence)
25+
26+
- Mbstring:
27+
. Fixed bug #63447 (max_input_vars doesn't filter variables when
28+
mbstring.encoding_translation = On). (Laruence)
29+
530
- MySQL:
631
. Fixed compilation failure on mixed 32/64 bit systems. (Andrey)
732

@@ -18,6 +43,10 @@ PHP NEWS
1843
. Fixed bug #63235 (buffer overflow in use of SQLGetDiagRec).
1944
(Martin Osvald, Remi)
2045

46+
- PDO_pgsql:
47+
. Fixed bug #62593 (Emulate prepares behave strangely with PARAM_BOOL).
48+
(Will Fitch)
49+
2150
- Streams:
2251
. Fixed bug #63240 (stream_get_line() return contains delimiter string).
2352
(Tjerk, Gustavo)
@@ -1381,6 +1410,7 @@ PHP NEWS
13811410

13821411
- GD extension:
13831412
. Fixed bug #53492 (fix crash if anti-aliasing steps are invalid). (Pierre)
1413+
. Fixed potential memory leak on a png error (Rasmus, Paul Saab)
13841414

13851415
- GMP extension:
13861416
. Fixed bug #52906 (gmp_mod returns negative result when non-negative is

TSRM/tsrm_virtual_cwd.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
# define IO_REPARSE_TAG_SYMLINK 0xA000000C
4141
# endif
4242

43+
# ifndef IO_REPARSE_TAG_DEDUP
44+
# define IO_REPARSE_TAG_DEDUP 0x80000013
45+
# endif
46+
4347
# ifndef VOLUME_NAME_NT
4448
# define VOLUME_NAME_NT 0x2
4549
# endif
@@ -958,6 +962,11 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
958962
return -1;
959963
};
960964
substitutename[substitutename_len] = 0;
965+
}
966+
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP) {
967+
isabsolute = 1;
968+
memcpy(substitutename, path, len + 1);
969+
substitutename_len = len;
961970
} else {
962971
tsrm_free_alloca(pbuffer, use_heap_large);
963972
return -1;

TSRM/tsrm_win32.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ PSID tsrm_win32_get_token_sid(HANDLE hToken)
193193
TSRM_API int tsrm_win32_access(const char *pathname, int mode)
194194
{
195195
time_t t;
196-
HANDLE thread_token;
196+
HANDLE thread_token = NULL;
197197
PSID token_sid;
198198
SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
199199
GENERIC_MAPPING gen_map = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, FILE_ALL_ACCESS };
@@ -365,6 +365,9 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
365365
}
366366

367367
Finished:
368+
if(thread_token != NULL) {
369+
CloseHandle(thread_token);
370+
}
368371
if(real_path != NULL) {
369372
free(real_path);
370373
real_path = NULL;

config.guess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ EOF
532532
echo rs6000-ibm-aix3.2
533533
fi
534534
exit ;;
535-
*:AIX:*:[456])
535+
*:AIX:*:[4567])
536536
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
537537
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
538538
IBM_ARCH=rs6000

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
4141

4242
PHP_MAJOR_VERSION=5
4343
PHP_MINOR_VERSION=3
44-
PHP_RELEASE_VERSION=19
44+
PHP_RELEASE_VERSION=20
4545
PHP_EXTRA_VERSION="-dev"
4646
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
4747
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`

ext/filter/filter_private.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@
107107
if (len < 1) { \
108108
RETURN_VALIDATION_FAILED \
109109
} \
110-
while (p[len-1] == ' ' || p[len-1] == '\t' || p[len-1] == '\r' || p[len-1] == '\v' || p[len-1] == '\n') { \
111-
len--; \
110+
if (len > 0) { \
111+
while (p[len-1] == ' ' || p[len-1] == '\t' || p[len-1] == '\r' || p[len-1] == '\v' || p[len-1] == '\n') { \
112+
len--; \
113+
} \
112114
} \
113115
}
114116

ext/gd/libgd/gd_png.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile)
127127
png_color_16p trans_gray_rgb;
128128
png_color_16p trans_color_rgb;
129129
png_bytep trans;
130-
png_bytep image_data = NULL;
131-
png_bytepp row_pointers = NULL;
130+
volatile png_bytep image_data = NULL;
131+
volatile png_bytepp row_pointers = NULL;
132132
gdImagePtr im = NULL;
133133
int i, j, *open = NULL;
134134
volatile int transparent = -1;

ext/libxml/libxml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static PHP_FUNCTION(libxml_set_streams_context)
699699
{
700700
zval *arg;
701701

702-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
702+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg) == FAILURE) {
703703
return;
704704
}
705705
if (LIBXML(stream_context)) {

ext/libxml/tests/004.phpt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@ echo "Done\n";
2727

2828
?>
2929
--EXPECTF--
30-
Warning: stream_context_create(): options should have the form ["wrappername"]["optionname"] = $value in %s004.php on line 10
31-
NULL
30+
Warning: stream_context_create(): options should have the form ["wrappername"]["optionname"] = $value in %s004.php on line %d
3231

33-
Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
34-
bool(true)
32+
Warning: libxml_set_streams_context() expects parameter 1 to be resource, null given in %s004.php on line %d
3533
NULL
36-
37-
Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
3834
bool(true)
39-
NULL
4035

41-
Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
42-
bool(true)
36+
Warning: libxml_set_streams_context() expects parameter 1 to be resource, string given in %s004.php on line %d
4337
NULL
38+
bool(true)
4439

45-
Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
40+
Warning: libxml_set_streams_context() expects parameter 1 to be resource, integer given in %s004.php on line %d
41+
NULL
4642
bool(true)
43+
44+
Warning: libxml_set_streams_context() expects parameter 1 to be resource, object given in %s004.php on line %d
4745
NULL
46+
bool(true)
4847

49-
Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context resource in %s004.php on line 18
48+
Warning: libxml_set_streams_context() expects parameter 1 to be resource, array given in %s004.php on line %d
49+
NULL
5050
bool(true)
5151
NULL
5252
bool(true)

ext/libxml/tests/bug63389.phpt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
Bug #63389 (Missing context check on libxml_set_streams_context() causes memleak)
3+
--SKIPIF--
4+
<?php if (!extension_loaded('libxml')) die('skip'); ?>
5+
--FILE--
6+
<?php
7+
$fp = fopen("php://input", "r");
8+
libxml_set_streams_context($fp);
9+
libxml_set_streams_context("a");
10+
echo "okey";
11+
?>
12+
--EXPECTF--
13+
Warning: libxml_set_streams_context() expects parameter 1 to be resource, string given in %sbug63389.php on line %d
14+
okey

ext/mbstring/mb_gpc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@ enum mbfl_no_encoding _php_mb_encoding_handler_ex(const php_mb_encoding_handler_
262262
n++;
263263
var = php_strtok_r(NULL, info->separator, &strtok_buf);
264264
}
265+
266+
if (n > (PG(max_input_vars) * 2)) {
267+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
268+
goto out;
269+
}
270+
265271
num = n; /* make sure to process initilized vars only */
266272

267273
/* initialize converter */

ext/mbstring/tests/bug63447_001.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On)
3+
--SKIPIF--
4+
<?php
5+
extension_loaded('mbstring') or die('skip');
6+
?>
7+
--INI--
8+
max_input_nesting_level=10
9+
max_input_vars=5
10+
mbstring.encoding_translation=1
11+
--POST--
12+
a=1&b=2&c=3&d=4&e=5&f=6
13+
--FILE--
14+
<?php
15+
var_dump($_POST);
16+
?>
17+
--EXPECT--
18+
Warning: Unknown: Input variables exceeded 5. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
19+
array(0) {
20+
}

ext/mbstring/tests/bug63447_002.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On)
3+
--SKIPIF--
4+
<?php
5+
extension_loaded('mbstring') or die('skip');
6+
?>
7+
--INI--
8+
max_input_nesting_level=10
9+
max_input_vars=4
10+
mbstring.encoding_translation=1
11+
--POST--
12+
a=1&b=2&c=3&d=4&e=5
13+
--FILE--
14+
<?php
15+
var_dump($_POST);
16+
?>
17+
--EXPECT--
18+
Warning: Unknown: Input variables exceeded 4. To increase the limit change max_input_vars in php.ini. in Unknown on line 0
19+
array(0) {
20+
}

ext/mbstring/tests/bug63447_003.phpt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
--TEST--
2+
Bug #63447 (max_input_vars doesn't filter variables when mbstring.encoding_translation = On)
3+
--SKIPIF--
4+
<?php
5+
extension_loaded('mbstring') or die('skip');
6+
?>
7+
--INI--
8+
max_input_nesting_level=5
9+
max_input_vars=100
10+
mbstring.encoding_translation=1
11+
--POST--
12+
a=1&b[][][]=2&c[][][][][][]=7
13+
--FILE--
14+
<?php
15+
print_r($_POST);
16+
?>
17+
--EXPECT--
18+
Array
19+
(
20+
[a] => 1
21+
[b] => Array
22+
(
23+
[0] => Array
24+
(
25+
[0] => Array
26+
(
27+
[0] => 2
28+
)
29+
30+
)
31+
32+
)
33+
34+
)

ext/mysqlnd/mysqlnd_wireprotocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ php_mysqlnd_rset_field_read(void *_packet, MYSQLND *conn TSRMLS_DC)
982982
p += 2;
983983
BAIL_IF_NO_MORE_DATA;
984984

985-
meta->decimals = uint2korr(p);
985+
meta->decimals = uint1korr(p);
986986
p += 1;
987987
BAIL_IF_NO_MORE_DATA;
988988

ext/pdo_pgsql/pgsql_statement.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,20 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
362362
}
363363
break;
364364
}
365+
} else {
366+
#endif
367+
if (param->is_param) {
368+
/* We need to manually convert to a pg native boolean value */
369+
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL &&
370+
((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) {
371+
SEPARATE_ZVAL(&param->parameter);
372+
param->param_type = PDO_PARAM_STR;
373+
ZVAL_STRINGL(param->parameter, Z_BVAL_P(param->parameter) ? "t" : "f", 1, 1);
374+
}
375+
}
376+
#if HAVE_PQPREPARE
365377
}
366-
#endif
378+
#endif
367379
return 1;
368380
}
369381

ext/pdo_pgsql/tests/bug62593.phpt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
--TEST--
2+
PDO PgSQL Bug #62593 (Emulate prepares behave strangely with PARAM_BOOL)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
6+
require dirname(__FILE__) . '/config.inc';
7+
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
8+
PDOTest::skip();
9+
?>
10+
--FILE--
11+
<?php
12+
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
13+
$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
14+
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
15+
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
16+
$errors = array();
17+
18+
$value = true;
19+
$query = $db->prepare('SELECT :foo IS FALSE as val_is_false');
20+
$query->bindValue(':foo', $value, PDO::PARAM_BOOL);
21+
$query->execute();
22+
$errors[] = $query->errorInfo();
23+
var_dump($value);
24+
25+
$query->bindValue(':foo', 0, PDO::PARAM_BOOL);
26+
$query->execute();
27+
$errors[] = $query->errorInfo();
28+
29+
// Verify bindParam maintains reference and only passes when execute is called
30+
$value = true;
31+
$query->bindParam(':foo', $value, PDO::PARAM_BOOL);
32+
$value = false;
33+
$query->execute();
34+
$errors[] = $query->errorInfo();
35+
var_dump($value);
36+
37+
$expect = 'No errors found';
38+
39+
foreach ($errors as $error)
40+
{
41+
if (strpos('Invalid text representation', $error[2]) !== false)
42+
{
43+
$expect = 'Invalid boolean found';
44+
}
45+
}
46+
echo $expect;
47+
?>
48+
--EXPECTF--
49+
bool(true)
50+
bool(false)
51+
No errors found

main/php_version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* edit configure.in to change version number */
33
#define PHP_MAJOR_VERSION 5
44
#define PHP_MINOR_VERSION 3
5-
#define PHP_RELEASE_VERSION 19
5+
#define PHP_RELEASE_VERSION 20
66
#define PHP_EXTRA_VERSION "-dev"
7-
#define PHP_VERSION "5.3.19-dev"
8-
#define PHP_VERSION_ID 50319
7+
#define PHP_VERSION "5.3.20-dev"
8+
#define PHP_VERSION_ID 50320

0 commit comments

Comments
 (0)