Skip to content

Commit

Permalink
Fix PDOStatement::execute parameter error in specific scenarios
Browse files Browse the repository at this point in the history
Array to string conversion occurs when the PDOStatement::execute parameter is empty in a specific scenario.
  • Loading branch information
longxinH committed Nov 17, 2018
1 parent 3af8fbd commit f07978b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion extension/php_xhprof.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern zend_module_entry xhprof_module_entry;
*/

/* XHProf version */
#define XHPROF_VERSION "2.0.4"
#define XHPROF_VERSION "2.0.5"

/* Fictitious function name to represent top of the call tree. The paranthesis
* in the name is to ensure we don't conflict with user function names. */
Expand Down
5 changes: 5 additions & 0 deletions extension/xhprof.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,11 @@ char* hp_trace_callback_pdo_statement_execute(char *symbol, zend_execute_data *d
return result;
#endif

if (ZEND_CALL_NUM_ARGS(data) < 1) {
spprintf(&result, 0, "%s#%s", symbol, Z_STRVAL_P(query_string));
return result;
}

arg = ZEND_CALL_ARG(data, 1);
if (Z_TYPE_P(arg) != IS_ARRAY) {
spprintf(&result, 0, "%s#%s", symbol, Z_STRVAL_P(query_string));
Expand Down

0 comments on commit f07978b

Please sign in to comment.