From: Christoph M. Becker Date: Mon, 12 Aug 2019 12:50:44 +0000 (+0200) Subject: Add missing argument checks X-Git-Tag: php-7.4.0beta4~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1189b18d21e9421ca726dfafb89b9e6dfe536c4;p=php Add missing argument checks These functions don't expect any arguments, so we should check that none are given. --- diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 9c018bf9c8..b9435521ca 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -653,6 +653,10 @@ PHP_FUNCTION(readline_callback_handler_install) Informs the readline callback interface that a character is ready for input */ PHP_FUNCTION(readline_callback_read_char) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } + if (Z_TYPE(_prepped_callback) != IS_UNDEF) { rl_callback_read_char(); } @@ -663,6 +667,10 @@ PHP_FUNCTION(readline_callback_read_char) Removes a previously installed callback handler and restores terminal settings */ PHP_FUNCTION(readline_callback_handler_remove) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } + if (Z_TYPE(_prepped_callback) != IS_UNDEF) { rl_callback_handler_remove(); zval_ptr_dtor(&_prepped_callback); @@ -677,6 +685,10 @@ PHP_FUNCTION(readline_callback_handler_remove) Ask readline to redraw the display */ PHP_FUNCTION(readline_redisplay) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } + #if HAVE_LIBEDIT /* seems libedit doesn't take care of rl_initialize in rl_redisplay * see bug #72538 */ @@ -693,6 +705,10 @@ PHP_FUNCTION(readline_redisplay) Inform readline that the cursor has moved to a new line */ PHP_FUNCTION(readline_on_new_line) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } + rl_on_new_line(); } /* }}} */