com php-src: Prevent segfault when no execution context set with "b <num>": phpdbg_prompt.c
| From: | Bob Weinand | Date: | Sun, 24 Nov 2013 12:03:00 +0000 |
| Subject: | com php-src: Prevent segfault when no execution context set with "b <num>": phpdbg_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74655@lists.php.net to get a copy of this message | ||
Commit: e8aab62d4d436d6ed2e089bd13d78390d1dfb68f
Author: Bob Weinand <bobwei9@hotmail.com> Sun, 24 Nov 2013 13:03:00 +0100
Parents: 7c51efd4735db75361ff842efa17b47cdc65f123
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e8aab62d4d436d6ed2e089bd13d78390d1dfb68f
Log:
Prevent segfault when no execution context set with "b <num>"
Changed paths:
M phpdbg_prompt.c
Diff:
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index a213065..fb6b5bc 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -775,7 +775,11 @@ PHPDBG_COMMAND(break) /* {{{ */
phpdbg_set_breakpoint_opline(param->addr TSRMLS_CC);
break;
case NUMERIC_PARAM:
- phpdbg_set_breakpoint_file(phpdbg_current_file(TSRMLS_C), param->num TSRMLS_CC);
+ if (PHPDBG_G(exec)) {
+ phpdbg_set_breakpoint_file(phpdbg_current_file(TSRMLS_C), param->num TSRMLS_CC);
+ } else {
+ phpdbg_error("Execution context not set !");
+ }
break;
case METHOD_PARAM:
phpdbg_set_breakpoint_method(param->method.class, param->method.name TSRMLS_CC);