From 0806f78f775edd5579f37b739fdf888fcb82a2e9 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Sun, 19 Jun 2011 14:27:33 +0000 Subject: [PATCH] - Added missing void param check in sys_get_temp_dir - Fixed param check of umask() --- ext/standard/file.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index 8fa933096a..6e829e02cc 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1498,7 +1498,10 @@ PHP_FUNCTION(umask) { long arg1 = 0; int oldumask; - int arg_count = ZEND_NUM_ARGS(); + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) { + RETURN_FALSE; + } oldumask = umask(077); @@ -1506,12 +1509,9 @@ PHP_FUNCTION(umask) BG(umask) = oldumask; } - if (arg_count == 0) { + if (ZEND_NUM_ARGS() == 0) { umask(oldumask); } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) { - RETURN_FALSE; - } umask(arg1); } @@ -2605,6 +2605,9 @@ PHP_FUNCTION(fnmatch) Returns directory path used for temporary files */ PHP_FUNCTION(sys_get_temp_dir) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } RETURN_STRING((char *)php_get_temporary_directory(), 1); } /* }}} */ -- 2.50.1