diff --git a/NEWS b/NEWS index 39260e4f704..8553567777a 100644 --- a/NEWS +++ b/NEWS @@ -29,6 +29,7 @@ PHP NEWS - PHPDBG: . Fix undefined behaviour in phpdbg_load_module_or_extension(). (nielsdos) + . Fix NULL pointer dereference in phpdbg_create_conditional_breal(). (nielsdos) - TSRM: . Fixed Windows shmget() wrt. IPC_PRIVATE. (Tyson Andre) diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index e48ed5ceba2..aa35402cfe6 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -829,19 +829,21 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co uint32_t cops = CG(compiler_options); zend_string *bp_code; - switch (param->type) { - case STR_PARAM: - case NUMERIC_FUNCTION_PARAM: - case METHOD_PARAM: - case NUMERIC_METHOD_PARAM: - case FILE_PARAM: - case ADDR_PARAM: - /* do nothing */ - break; + if (param) { + switch (param->type) { + case STR_PARAM: + case NUMERIC_FUNCTION_PARAM: + case METHOD_PARAM: + case NUMERIC_METHOD_PARAM: + case FILE_PARAM: + case ADDR_PARAM: + /* do nothing */ + break; - default: - phpdbg_error("Invalid parameter type for conditional breakpoint"); - return; + default: + phpdbg_error("Invalid parameter type for conditional breakpoint"); + return; + } } PHPDBG_BREAK_INIT(new_break, PHPDBG_BREAK_COND);