Skip to content

Commit b3709bf

Browse files
committed
Merge branch 'PHP-5.6'
* PHP-5.6: (27 commits) fix non-standard C update NEWS 5.4.41 next fix CVE num update NEWS Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode) fix test fix type in fix for #69085 fix memory leak & add test Fix tests fix CVE num Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability) Fix test Additional fix for bug #69324 More fixes for bug #69152 Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions) Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar) Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER) Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4) Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault) ... Conflicts: Zend/zend_exceptions.c ext/curl/interface.c ext/dom/document.c ext/fileinfo/libmagic/softmagic.c ext/gd/gd.c ext/hash/hash.c ext/pgsql/pgsql.c ext/phar/phar.c ext/phar/phar_internal.h ext/standard/http_fopen_wrapper.c ext/standard/link.c ext/standard/streamsfuncs.c ext/xmlwriter/php_xmlwriter.c ext/zlib/zlib.c
2 parents cddb5eb + 5776fce commit b3709bf

33 files changed

+320
-81
lines changed

Zend/zend_exceptions.c

+3
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,9 @@ ZEND_METHOD(exception, getTraceAsString)
557557
DEFAULT_0_PARAMS;
558558

559559
trace = zend_read_property(base_exception_ce, getThis(), "trace", sizeof("trace")-1, 1, &rv);
560+
if(Z_TYPE_P(trace) != IS_ARRAY) {
561+
RETURN_FALSE;
562+
}
560563
ZEND_HASH_FOREACH_NUM_KEY_VAL(Z_ARRVAL_P(trace), index, frame) {
561564
if (Z_TYPE_P(frame) != IS_ARRAY) {
562565
zend_error(E_WARNING, "Expected array for frame %pu", index);

ext/curl/interface.c

+5
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,7 @@ static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
13451345
php_error_docref(NULL, E_WARNING, "Could not call the CURLOPT_WRITEFUNCTION");
13461346
length = -1;
13471347
} else if (!Z_ISUNDEF(retval)) {
1348+
_php_curl_verify_handlers(ch, 1);
13481349
if (Z_TYPE(retval) != IS_LONG) {
13491350
convert_to_long_ex(&retval);
13501351
}
@@ -1397,6 +1398,7 @@ static int curl_fnmatch(void *ctx, const char *pattern, const char *string)
13971398
if (error == FAILURE) {
13981399
php_error_docref(NULL, E_WARNING, "Cannot call the CURLOPT_FNMATCH_FUNCTION");
13991400
} else if (!Z_ISUNDEF(retval)) {
1401+
_php_curl_verify_handlers(ch, 1);
14001402
if (Z_TYPE(retval) != IS_LONG) {
14011403
convert_to_long_ex(&retval);
14021404
}
@@ -1456,6 +1458,7 @@ static size_t curl_progress(void *clientp, double dltotal, double dlnow, double
14561458
if (error == FAILURE) {
14571459
php_error_docref(NULL, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
14581460
} else if (!Z_ISUNDEF(retval)) {
1461+
_php_curl_verify_handlers(ch, 1);
14591462
if (Z_TYPE(retval) != IS_LONG) {
14601463
convert_to_long_ex(&retval);
14611464
}
@@ -1524,6 +1527,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
15241527
length = CURL_READFUNC_ABORT;
15251528
#endif
15261529
} else if (!Z_ISUNDEF(retval)) {
1530+
_php_curl_verify_handlers(ch, 1);
15271531
if (Z_TYPE(retval) == IS_STRING) {
15281532
length = MIN((int) (size * nmemb), Z_STRLEN(retval));
15291533
memcpy(data, Z_STRVAL(retval), length);
@@ -1589,6 +1593,7 @@ static size_t curl_write_header(char *data, size_t size, size_t nmemb, void *ctx
15891593
php_error_docref(NULL, E_WARNING, "Could not call the CURLOPT_HEADERFUNCTION");
15901594
length = -1;
15911595
} else if (!Z_ISUNDEF(retval)) {
1596+
_php_curl_verify_handlers(ch, 1);
15921597
if (Z_TYPE(retval) != IS_LONG) {
15931598
convert_to_long_ex(&retval);
15941599
}

ext/curl/tests/bug69316.phpt

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
--TEST--
2+
Bug #69316: Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER
3+
--SKIPIF--
4+
<?php include 'skipif.inc'; ?>
5+
--FILE--
6+
<?php
7+
function hdr_callback($ch, $data) {
8+
// close the stream, causing the FILE structure to be free()'d
9+
if($GLOBALS['f_file']) {
10+
fclose($GLOBALS['f_file']); $GLOBALS['f_file'] = 0;
11+
12+
// cause an allocation of approx the same size as a FILE structure, size varies a bit depending on platform/libc
13+
$FILE_size = (PHP_INT_SIZE == 4 ? 0x160 : 0x238);
14+
curl_setopt($ch, CURLOPT_COOKIE, str_repeat("a", $FILE_size - 1));
15+
}
16+
return strlen($data);
17+
}
18+
19+
include 'server.inc';
20+
$host = curl_cli_server_start();
21+
$temp_file = dirname(__FILE__) . '/body.tmp';
22+
$url = "{$host}/get.php?test=getpost";
23+
$ch = curl_init();
24+
$f_file = fopen($temp_file, "w") or die("failed to open file\n");
25+
curl_setopt($ch, CURLOPT_BUFFERSIZE, 10);
26+
curl_setopt($ch, CURLOPT_HEADERFUNCTION, "hdr_callback");
27+
curl_setopt($ch, CURLOPT_FILE, $f_file);
28+
curl_setopt($ch, CURLOPT_URL, $url);
29+
curl_exec($ch);
30+
curl_close($ch);
31+
?>
32+
===DONE===
33+
--CLEAN--
34+
<?php
35+
unlink(dirname(__FILE__) . '/body.tmp');
36+
?>
37+
--EXPECTF--
38+
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
39+
array(1) {
40+
["test"]=>
41+
string(7) "getpost"
42+
}
43+
array(0) {
44+
}
45+
===DONE===

ext/dom/document.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,11 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, size_t so
13791379
xmlInitParser();
13801380

13811381
if (mode == DOM_LOAD_FILE) {
1382-
char *file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN );
1382+
char *file_dest;
1383+
if (CHECK_NULL_PATH(source, source_len)) {
1384+
return NULL;
1385+
}
1386+
file_dest = _dom_get_valid_file_path(source, resolved_path, MAXPATHLEN);
13831387
if (file_dest) {
13841388
ctxt = xmlCreateFileParserCtxt(file_dest);
13851389
}
@@ -1979,7 +1983,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
19791983

19801984
id = getThis();
19811985

1982-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &source, &source_len, &options) == FAILURE) {
1986+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &source, &source_len, &options) == FAILURE) {
19831987
return;
19841988
}
19851989

ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ assert.bail=true
1313
$doc = new DOMDocument();
1414
$result = $doc->loadHTMLFile("");
1515
assert('$result === false');
16+
$doc = new DOMDocument();
17+
$result = $doc->loadHTMLFile("text.html\0something");
18+
assert('$result === null');
1619
?>
1720
--EXPECTF--
1821
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s
22+
23+
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile() expects parameter 1 to be a valid path, string given %s

ext/fileinfo/fileinfo.c

+5
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,11 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
531531
RETVAL_FALSE;
532532
goto clean;
533533
}
534+
if (CHECK_NULL_PATH(buffer, buffer_len)) {
535+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
536+
RETVAL_FALSE;
537+
goto clean;
538+
}
534539

535540
wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0);
536541

ext/fileinfo/libmagic/softmagic.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,14 @@ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
11011101
if (bytecnt > nbytes) {
11021102
bytecnt = nbytes;
11031103
}
1104-
1104+
if (offset > bytecnt) {
1105+
offset = bytecnt;
1106+
}
1107+
if (s == NULL) {
1108+
ms->search.s_len = 0;
1109+
ms->search.s = NULL;
1110+
return 0;
1111+
}
11051112
buf = RCAST(const char *, s) + offset;
11061113
end = last = RCAST(const char *, s) + bytecnt;
11071114
/* mget() guarantees buf <= last */

ext/fileinfo/tests/bug68819_001.phpt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
Bug #68819 Fileinfo on specific file causes spurious OOM and/or segfault, var 1
3+
--SKIPIF--
4+
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
8+
$string = <<<HERE
9+
----a-----'''---------a---------------a--------a-----a-----a---------a-----as-------a----a--a-------------a--as-----s---------------a---------a---a--s-a-----a-----------asy---------a-----a-----------a----s--------a-------------a-------a--------a----s------------a-----a----------------a----s-----------------\r\n-------------------a-------a-a-------a-----a----a----s----s--------a-----------------------a----a----s-------------a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a----s----s--------a----------a----------------------a----a----s-------------a----------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n------a-------a-a-------a-----a----a---a-----a-----------------------a----a---a-----a------------------s-------a----a---a-----a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s------\r\n-------------------a-------a-a-------a-----a----a---a-------a------------------------a----a---a-----''--a-------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a-------s-----a---a-------------------------a----a-------------a---a-------------------s-------a----a-------------a---a-----as-a--------------a-----a--s----s---------y------------a-----a-s---a-------''----a---s--a-''------''----s------------a-y----------------s------a-----y--a-s--a-s------s--a-s----------''----------------------------a---s--a----a---------a-s---a-s--------s--------a---------s--a-y-------------as----a----a-------------a------a---s--a-s------a--------a----s----y--as--a----a-s---------------a-----a--------------------------------------\r\n-------------------a-------a-a-------a-----a----a-----------s--------a-----------------------a----a--------------------a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a-----------s--------a----------a----------------------a----a--------------------a------------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a---a-----------------------a----a---a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a---a----------a----------------------a----a---a------------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-----a-a-----------a-------a-a-------a-----a----a----a---s-----a-----------------------a----a----a---------a-----------------s-------a----a----a---------a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a--------a----a-----------------------a----a----------a----a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-----a-------------a-------a-a-------a-----a----a--------s-----a---a-------------------------a----a--------------a---a-------------------s-------------a---------------a----a---a---a-----as-a--------------a-----a--s----s---------y------------a-----a-s---a-------''----a---s--a-''------''----s------------a-y----------------s------a-----y--a-s--a-s------s--a-s----------''----------------------------a---s--a----a---------a-s---a-s--------s--------a---------s--a-y-------------as----a----a-------------a------a---s--a-s------a--------a----s----y--as--a----a-s---------------a-----a--------------------------------------\r\n-------------------a-------a-a-------a-----a----a----------------a-----------------------a----a----------------a------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a-------a-----a----a----------------a----------a----------------------a----a----------------a-----------------------------s-------a----a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n---a---------------a-------a-a-------a-----as------------------------a--a--s------------------a-s------------------------a-----s--a-----'''----------a-s---------------------------------------------a-----s--a-----------------a---------a---a--s-a-----a-----------asy---------a-----a-----------a----s----------------------a----s--a-------------a-------a--------a----s------------a-----a----------------a----s------------------\r\n-a-----------------a-------a-a-------a--y---------a------------------y---------a-----'''-------y------a-y--a-------------------------a---------a---a----------as-a---a--s-a-----a-----------asy---------a-----a-----------a----s--------a-------------a-------a--------a----s---------a-----a----------------a----s------------------\r\n-a-----------------a-------a-a-------a--y-------------a------------------y-------------a-----'''-------y----------a-y--a-------------------------a---------a---a----------as-a---a--s-a-----a-----------asy---------a-----a-----------a----s--------a-------------a-------a--------a----s---------a-----a----------------a----s------------------\r\n-------------------a-------a-a-------a--a----a-----a------------------a----a-----a-----'''----------a----s----a----a-------s---a------------------a-----------a--s-a-----a---------------------a------a----s-a-----a-------s-s-------a----s--------a-------------a-------a--------a----s---------a-----a----------------a----s------------------\r\n------aa-----------a-------a-a------------s-a--s---------a---a------------------------a------------a---a------------------s--------a------------a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a------------------------s-----s--a----a-----------------------------------------s--a----a------------------s---------------------------------s--a----a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s--------------a-----a----------a----------s--a----------s-----------------\r\n-------------------a-------a-a--------------s-a---a--------------------------a---a------------------s----------a---a------as---s-a--------------s-----a------a-y--a-------a-----a--a--------a----s--------a-------------a-------a--------a----s---------------a-----a----------a----------s--a----------s-----------------\r\nsay-------a------------s-----''------a----s--------a-------------a-\r\n
10+
HERE;
11+
12+
$finfo = new finfo();
13+
$type = $finfo->buffer($string);
14+
15+
var_dump($type);
16+
?>
17+
--EXPECT--
18+
string(60) "ASCII text, with very long lines, with CRLF line terminators"

ext/fileinfo/tests/bug68819_002.phpt

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
Bug #68819 Fileinfo on specific file causes spurious OOM and/or segfault, var 2
3+
--SKIPIF--
4+
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5+
--FILE--
6+
<?php
7+
8+
$string = '';
9+
10+
// These two in any order
11+
$string .= "\r\n";
12+
$string .= "''''";
13+
14+
// Total string length > 8192
15+
$string .= str_repeat(chr(rand(32, 127)), 8184);
16+
17+
// Ending in this string
18+
$string .= "say";
19+
20+
$finfo = new finfo();
21+
$type = $finfo->buffer($string);
22+
var_dump($type);
23+
24+
?>
25+
--EXPECT--
26+
string(60) "ASCII text, with very long lines, with CRLF line terminators"

ext/fileinfo/tests/finfo_file_basic.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ echo "*** Testing finfo_file() : basic functionality ***\n";
1919
var_dump( finfo_file( $finfo, __FILE__) );
2020
var_dump( finfo_file( $finfo, __FILE__, FILEINFO_CONTINUE ) );
2121
var_dump( finfo_file( $finfo, $magicFile ) );
22+
var_dump( finfo_file( $finfo, $magicFile.chr(0).$magicFile) );
2223

2324
?>
2425
===DONE===
@@ -27,4 +28,7 @@ var_dump( finfo_file( $finfo, $magicFile ) );
2728
string(28) "text/x-php; charset=us-ascii"
2829
string(22) "PHP script, ASCII text"
2930
string(25) "text/plain; charset=utf-8"
31+
32+
Warning: finfo_file(): Invalid path in %s/finfo_file_basic.php on line %d
33+
bool(false)
3034
===DONE===

ext/gd/gd.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -2405,15 +2405,15 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
24052405
#endif
24062406

24072407
if (image_type == PHP_GDIMG_TYPE_GD2PART) {
2408-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
2408+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "pllll", &file, &file_len, &srcx, &srcy, &width, &height) == FAILURE) {
24092409
return;
24102410
}
24112411
if (width < 1 || height < 1) {
24122412
php_error_docref(NULL, E_WARNING, "Zero width or height not allowed");
24132413
RETURN_FALSE;
24142414
}
24152415
} else {
2416-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
2416+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &file, &file_len) == FAILURE) {
24172417
return;
24182418
}
24192419
}
@@ -4155,7 +4155,7 @@ PHP_FUNCTION(imagepsencodefont)
41554155
size_t enc_len;
41564156
int *f_ind;
41574157

4158-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &fnt, &enc, &enc_len) == FAILURE) {
4158+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp", &fnt, &enc, &enc_len) == FAILURE) {
41594159
return;
41604160
}
41614161

ext/gd/tests/imageloadfont_error1.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Testing that imageloadfont() breaks on non-string first parameter
33
--CREDITS--
44
Neveo Harrison <neveoo [at] gmail [dot] com> #testfest #tek11
55
--SKIPIF--
6-
<?php
6+
<?php
77
if (!extension_loaded("gd")) die("skip GD not present");
88
?>
99
--FILE--

ext/hash/hash.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
137137
}
138138
if (isfilename) {
139139
if (CHECK_NULL_PATH(data, data_len)) {
140+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
140141
RETURN_FALSE;
141142
}
142143
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
@@ -254,6 +255,10 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
254255
RETURN_FALSE;
255256
}
256257
if (isfilename) {
258+
if (CHECK_NULL_PATH(data, data_len)) {
259+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid path");
260+
RETURN_FALSE;
261+
}
257262
stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
258263
if (!stream) {
259264
/* Stream will report errors opening file */
@@ -464,7 +469,7 @@ PHP_FUNCTION(hash_update_file)
464469
char *filename, buf[1024];
465470
size_t filename_len, n;
466471

467-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
472+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rp|r", &zhash, &filename, &filename_len, &zcontext) == FAILURE) {
468473
return;
469474
}
470475

ext/hash/tests/hash_hmac_file_error.phpt

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ hash_hmac_file('crc32', $file, $key, TRUE, $extra_arg);
2828
echo "\n-- Testing hash_hmac_file() function with invalid hash algorithm --\n";
2929
hash_hmac_file('foo', $file, $key, TRUE);
3030

31+
echo "\n-- Testing hash_hmac_file() function with bad path --\n";
32+
hash_hmac_file('crc32', $file.chr(0).$file, $key, TRUE);
33+
3134
?>
3235
===Done===
3336
--EXPECTF--
@@ -51,4 +54,8 @@ Warning: hash_hmac_file() expects at most 4 parameters, 5 given in %s on line %d
5154
-- Testing hash_hmac_file() function with invalid hash algorithm --
5255

5356
Warning: hash_hmac_file(): Unknown hashing algorithm: foo in %s on line %d
57+
58+
-- Testing hash_hmac_file() function with bad path --
59+
60+
Warning: hash_hmac_file(): Invalid path in %s on line %d
5461
===Done===

ext/pgsql/pgsql.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3126,7 +3126,7 @@ PHP_FUNCTION(pg_trace)
31263126
php_stream *stream;
31273127
zend_resource *link;
31283128

3129-
if (zend_parse_parameters(argc, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
3129+
if (zend_parse_parameters(argc, "p|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
31303130
return;
31313131
}
31323132

0 commit comments

Comments
 (0)