Skip to content

Commit f07978b

Browse files
committed
Fix PDOStatement::execute parameter error in specific scenarios
Array to string conversion occurs when the PDOStatement::execute parameter is empty in a specific scenario.
1 parent 3af8fbd commit f07978b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

extension/php_xhprof.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extern zend_module_entry xhprof_module_entry;
3939
*/
4040

4141
/* XHProf version */
42-
#define XHPROF_VERSION "2.0.4"
42+
#define XHPROF_VERSION "2.0.5"
4343

4444
/* Fictitious function name to represent top of the call tree. The paranthesis
4545
* in the name is to ensure we don't conflict with user function names. */

extension/xhprof.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,6 +1501,11 @@ char* hp_trace_callback_pdo_statement_execute(char *symbol, zend_execute_data *d
15011501
return result;
15021502
#endif
15031503

1504+
if (ZEND_CALL_NUM_ARGS(data) < 1) {
1505+
spprintf(&result, 0, "%s#%s", symbol, Z_STRVAL_P(query_string));
1506+
return result;
1507+
}
1508+
15041509
arg = ZEND_CALL_ARG(data, 1);
15051510
if (Z_TYPE_P(arg) != IS_ARRAY) {
15061511
spprintf(&result, 0, "%s#%s", symbol, Z_STRVAL_P(query_string));

0 commit comments

Comments
 (0)