Skip to content

Commit b1189b1

Browse files
committed
Add missing argument checks
These functions don't expect any arguments, so we should check that none are given.
1 parent a18ad19 commit b1189b1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ext/readline/readline.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,10 @@ PHP_FUNCTION(readline_callback_handler_install)
653653
Informs the readline callback interface that a character is ready for input */
654654
PHP_FUNCTION(readline_callback_read_char)
655655
{
656+
if (zend_parse_parameters_none() == FAILURE) {
657+
return;
658+
}
659+
656660
if (Z_TYPE(_prepped_callback) != IS_UNDEF) {
657661
rl_callback_read_char();
658662
}
@@ -663,6 +667,10 @@ PHP_FUNCTION(readline_callback_read_char)
663667
Removes a previously installed callback handler and restores terminal settings */
664668
PHP_FUNCTION(readline_callback_handler_remove)
665669
{
670+
if (zend_parse_parameters_none() == FAILURE) {
671+
return;
672+
}
673+
666674
if (Z_TYPE(_prepped_callback) != IS_UNDEF) {
667675
rl_callback_handler_remove();
668676
zval_ptr_dtor(&_prepped_callback);
@@ -677,6 +685,10 @@ PHP_FUNCTION(readline_callback_handler_remove)
677685
Ask readline to redraw the display */
678686
PHP_FUNCTION(readline_redisplay)
679687
{
688+
if (zend_parse_parameters_none() == FAILURE) {
689+
return;
690+
}
691+
680692
#if HAVE_LIBEDIT
681693
/* seems libedit doesn't take care of rl_initialize in rl_redisplay
682694
* see bug #72538 */
@@ -693,6 +705,10 @@ PHP_FUNCTION(readline_redisplay)
693705
Inform readline that the cursor has moved to a new line */
694706
PHP_FUNCTION(readline_on_new_line)
695707
{
708+
if (zend_parse_parameters_none() == FAILURE) {
709+
return;
710+
}
711+
696712
rl_on_new_line();
697713
}
698714
/* }}} */

0 commit comments

Comments
 (0)