From 35d5cd5c6e2d160952274b67d4c20e59f351dd0b Mon Sep 17 00:00:00 2001 From: Insu Yun Date: Tue, 12 Jan 2016 04:21:57 +0000 Subject: phpdbg: fix potential format string bug --- sapi/phpdbg/phpdbg_prompt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sapi/phpdbg/phpdbg_prompt.c') diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 97249765f8..796519ffdf 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -651,7 +651,7 @@ static inline void phpdbg_handle_exception(void) /* {{{ */ phpdbg_error("exception", "name=\"%s\" file=\"%s\" line=\"" ZEND_LONG_FMT "\"", "Uncaught %s in %s on line " ZEND_LONG_FMT, ZSTR_VAL(ex->ce->name), ZSTR_VAL(file), line); zend_string_release(file); - phpdbg_writeln("exceptionmsg", "msg=\"%s\"", ZSTR_VAL(msg)); + phpdbg_writeln("exceptionmsg", "msg=\"%s\"", "%s", ZSTR_VAL(msg)); zend_string_release(msg); if (EG(prev_exception)) { @@ -1627,7 +1627,7 @@ next: execute_data->call->func->type == ZEND_USER_FUNCTION) { zend_execute_ex = execute_ex; } - PHPDBG_G(vmret) = zend_vm_call_opcode_handler(execute_data); + PHPDBG_G(vmret) = zend_vm_call_opcode_handler(execute_data); zend_execute_ex = phpdbg_execute_ex; if (PHPDBG_G(vmret) != 0) { -- cgit v1.2.1 From c67c166f930b2f815a805a3376e9244794e20c31 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 2 Mar 2016 17:50:55 +0300 Subject: Removed zend_fcall_info.symbol_table --- sapi/phpdbg/phpdbg_prompt.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sapi/phpdbg/phpdbg_prompt.c') diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 5b3b546466..8a4bd3a3ac 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -122,7 +122,6 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */ fci.size = sizeof(zend_fcall_info); fci.function_table = &PHPDBG_G(registered); //???fci.symbol_table = zend_rebuild_symbol_table(); - fci.symbol_table = NULL; fci.object = NULL; fci.retval = &fretval; fci.no_separation = 1; -- cgit v1.2.1 From f0a2e8eb13b3971ec11baa2a6029ed7c4cb0064b Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 27 Apr 2016 13:46:38 +0300 Subject: Removed "zend_fcall_info.function_table". It was assigned in many places, but is never used. --- sapi/phpdbg/phpdbg_prompt.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sapi/phpdbg/phpdbg_prompt.c') diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index ac86c15629..a9fd351ffd 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -120,7 +120,6 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */ ZVAL_STRINGL(&fci.function_name, lc_name, name->len); fci.size = sizeof(zend_fcall_info); - fci.function_table = &PHPDBG_G(registered); //???fci.symbol_table = zend_rebuild_symbol_table(); fci.object = NULL; fci.retval = &fretval; -- cgit v1.2.1 From 6499162ff0d8aa6e862d3e3cdd2288b87636b8a1 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 28 Apr 2016 04:13:34 +0300 Subject: - get rid of EG(scope). zend_get_executed_scope() should be used instead. - ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter. --- sapi/phpdbg/phpdbg_prompt.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sapi/phpdbg/phpdbg_prompt.c') diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index a9fd351ffd..787517dd9d 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -797,7 +797,6 @@ PHPDBG_COMMAND(ev) /* {{{ */ zval retval; zend_execute_data *original_execute_data = EG(current_execute_data); - zend_class_entry *original_scope = EG(scope); zend_vm_stack original_stack = EG(vm_stack); zend_object *ex = NULL; @@ -845,7 +844,6 @@ PHPDBG_COMMAND(ev) /* {{{ */ OBJ_RELEASE(ex); } EG(current_execute_data) = original_execute_data; - EG(scope) = original_scope; EG(vm_stack_top) = original_stack->top; EG(vm_stack_end) = original_stack->end; EG(vm_stack) = original_stack; -- cgit v1.2.1 From 747a482b9c011b33d3e61823d3291c2258eaec9e Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 28 Apr 2016 15:17:24 +0300 Subject: Don't initialize EX(call)->symbol_table on each function call. Keep it uninitialized, and check ZEND_CALL_HAS_SYMBOL_TABLE flag when necessary. --- sapi/phpdbg/phpdbg_prompt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/phpdbg/phpdbg_prompt.c') diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index 787517dd9d..3b7274a997 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -687,7 +687,7 @@ PHPDBG_COMMAND(run) /* {{{ */ } /* clean up from last execution */ - if (ex && ex->symbol_table) { + if (ex && (ZEND_CALL_INFO(ex) & ZEND_CALL_HAS_SYMBOL_TABLE)) { zend_hash_clean(ex->symbol_table); } else { zend_rebuild_symbol_table(); -- cgit v1.2.1