Skip to content

Commit 2b6be48

Browse files
committed
Merge remote-tracking branch 'origin/str_size_and_int64_56_backport' into str_size_and_int64
* origin/str_size_and_int64_56_backport: (168 commits) some more after merge fixes fixed macro names removed /EHa as __try/__catch syntax is used anyway fix ZEND_DEBUG usage fixed test updated NEWS updated NEWS Fixed bug #67118 DateTime constructor crash with invalid data update NEWS update NEWS add a test case previously broken by a bad fix Revert "Fixed bug #64604" updated libmagic.patch for 5.6+ updated libmagic.patch backport this piece from 5.6, related to the #66307 fix updated NEWS Fixed bug #66307 Fileinfo crashes with powerpoint files fix CFLAGS_PHPDBGS and some formatting use a portable strndup implementation fixed C89 compat ...
2 parents f3e56c8 + 047a39c commit 2b6be48

Some content is hidden

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

75 files changed

+9185
-2180
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ sapi/fpm/php-fpm.1
246246
sapi/fpm/init.d.php-fpm
247247
sapi/fpm/php-fpm.conf
248248
sapi/fpm/fpm/php-cgi
249+
sapi/phpdbg/phpdbg_parser.c
250+
sapi/phpdbg/phpdbg_parser.h
249251
sapi/phpdbg/phpdbg
250252
scripts/php-config
251253
scripts/phpize

ext/date/php_date.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2716,7 +2716,9 @@ PHP_METHOD(DateTime, __construct)
27162716

27172717
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
27182718
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|SO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
2719-
php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
2719+
if (!php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) {
2720+
ZVAL_NULL(getThis());
2721+
}
27202722
}
27212723
zend_restore_error_handling(&error_handling TSRMLS_CC);
27222724
}

ext/date/tests/bug67118.phpt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
Bug #67118 php-cgi crashes regularly on IIS 7
3+
--INI--
4+
date.timezone=Europe/Berlin
5+
--FILE--
6+
<?php
7+
class mydt extends datetime
8+
{
9+
public function __construct($time = 'now', $tz = NULL, $format = NULL)
10+
{
11+
if (!empty($tz) && !is_object($tz)) {
12+
$tz = new DateTimeZone($tz);
13+
}
14+
15+
@parent::__construct($time, $tz);
16+
}
17+
18+
};
19+
20+
new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
21+
--EXPECTF--
22+
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (Funktionsansvarig rådgivning och juridik) at position 0 (F): The timezone could not be found in the database' in %sbug67118.php:%d
23+
Stack trace:
24+
#0 %sbug67118.php(%d): DateTime->__construct('Funktionsansvar...', Object(DateTimeZone))
25+
#1 %sbug67118.php(%d): mydt->__construct('Funktionsansvar...', 'UTC')
26+
#2 {main}
27+
thrown in %sbug67118.php on line %d

ext/fileinfo/libmagic.patch

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
25432543
}
25442544
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
25452545
--- libmagic.orig/readcdf.c Tue Jan 7 04:13:42 2014
2546-
+++ libmagic/readcdf.c Fri Feb 21 00:21:27 2014
2546+
+++ libmagic/readcdf.c Thu Apr 24 20:07:51 2014
25472547
@@ -30,7 +30,11 @@
25482548
#endif
25492549

@@ -2567,7 +2567,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
25672567
private const char *
25682568
cdf_app_to_mime(const char *vbuf, const struct nv *nv)
25692569
{
2570-
@@ -91,7 +99,7 @@
2570+
@@ -91,12 +99,14 @@
25712571
{
25722572
size_t i;
25732573
cdf_timestamp_t tp;
@@ -2576,7 +2576,14 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
25762576
char buf[64];
25772577
const char *str = NULL;
25782578
const char *s;
2579-
@@ -162,8 +170,12 @@
2579+
int len;
2580+
2581+
+ memset(&ts, 0, sizeof(ts));
2582+
+
2583+
for (i = 0; i < count; i++) {
2584+
cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
2585+
switch (info[i].pi_type) {
2586+
@@ -162,8 +172,12 @@
25802587
case CDF_FILETIME:
25812588
tp = info[i].pi_tp;
25822589
if (tp != 0) {
@@ -2591,7 +2598,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
25912598
cdf_print_elapsed_time(tbuf,
25922599
sizeof(tbuf), tp);
25932600
if (NOTMIME(ms) && file_printf(ms,
2594-
@@ -171,8 +183,11 @@
2601+
@@ -171,8 +185,11 @@
25952602
return -1;
25962603
} else {
25972604
char *c, *ec;
@@ -3279,3 +3286,4 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
32793286
break;
32803287
}
32813288
case FILE_INDIRECT:
3289+

ext/fileinfo/libmagic/readcdf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
105105
const char *s;
106106
int len;
107107

108+
memset(&ts, 0, sizeof(ts));
109+
108110
for (i = 0; i < count; i++) {
109111
cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
110112
switch (info[i].pi_type) {

ext/fileinfo/tests/finfo_file_002.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ksort($results);
1818
var_dump($results);
1919
?>
2020
--EXPECTF--
21-
array(8) {
21+
array(9) {
2222
["%s/resources/dir.zip"]=>
2323
string(15) "application/zip"
2424
["%s/resources/test.awk"]=>
@@ -35,4 +35,6 @@ array(8) {
3535
string(15) "application/pdf"
3636
["%s/resources/test.png"]=>
3737
string(9) "image/png"
38+
["%s/resources/test.ppt"]=>
39+
string(29) "application/vnd.ms-powerpoint"
3840
}

ext/fileinfo/tests/resources/test.ppt

97.5 KB
Binary file not shown.

ext/pdo_odbc/odbc_stmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
552552
struct pdo_column_data *col = &stmt->columns[colno];
553553
RETCODE rc;
554554
SWORD colnamelen;
555-
SDWORD colsize;
555+
SQLULEN colsize;
556556
SQLLEN displaysize;
557557

558558
rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname,

0 commit comments

Comments
 (0)