]> granicus.if.org Git - php/commitdiff
Add missing argument checks
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 12 Aug 2019 12:50:44 +0000 (14:50 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 12 Aug 2019 13:36:35 +0000 (15:36 +0200)
These functions don't expect any arguments, so we should check that
none are given.

ext/readline/readline.c

index 9c018bf9c859f4f9c65e746d059a424f94bcda12..b9435521ca8baeca9964b7f187bee28e51805b4c 100644 (file)
@@ -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();
 }
 /* }}} */