Skip to content

Commit ffac60e

Browse files
author
felipe
committed
- Added missing void param check in sys_get_temp_dir
- Fixed param check of umask() git-svn-id: http://svn.php.net/repository/php/php-src/trunk@312284 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent 3a14ecc commit ffac60e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ext/standard/file.c

+8-5
Original file line numberDiff line numberDiff line change
@@ -1413,20 +1413,20 @@ PHP_FUNCTION(umask)
14131413
{
14141414
long arg1 = 0;
14151415
int oldumask;
1416-
int arg_count = ZEND_NUM_ARGS();
1416+
1417+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
1418+
RETURN_FALSE;
1419+
}
14171420

14181421
oldumask = umask(077);
14191422

14201423
if (BG(umask) == -1) {
14211424
BG(umask) = oldumask;
14221425
}
14231426

1424-
if (arg_count == 0) {
1427+
if (ZEND_NUM_ARGS() == 0) {
14251428
umask(oldumask);
14261429
} else {
1427-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
1428-
RETURN_FALSE;
1429-
}
14301430
umask(arg1);
14311431
}
14321432

@@ -2491,6 +2491,9 @@ PHP_FUNCTION(fnmatch)
24912491
Returns directory path used for temporary files */
24922492
PHP_FUNCTION(sys_get_temp_dir)
24932493
{
2494+
if (zend_parse_parameters_none() == FAILURE) {
2495+
return;
2496+
}
24942497
RETURN_STRING((char *)php_get_temporary_directory(), 1);
24952498
}
24962499
/* }}} */

0 commit comments

Comments
 (0)