[xdebug-dev] xdebug xdebug/xdebug.c - Fixed bug #85: Xdebug segfaults when no idekey is set.

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Thu, 5 Aug 2004 13:07:27 +0200

Date: Thu Aug 5 13:07:26 CEST 2004
User: Derick Rethans
Directory: xdebug

Log Message:
[1.50]
- Fixed bug #85: Xdebug segfaults when no idekey is set.

Modified files:
           xdebug/xdebug.c (version: 1.231)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.230
retrieving revision 1.231
diff -u -r1.230 -r1.231
--- xdebug/xdebug.c:1.230 Tue Aug 03 18:46:06 2004 GMT
+++ xdebug/xdebug.c Thu Aug 05 09:07:26 2004 GMT
@@ -200,6 +200,19 @@
         return SUCCESS;
 }
 
+static PHP_INI_MH(OnUpdateIDEKey)
+{
+ if (XG(ide_key)) {
+ xdfree(XG(ide_key));
+ }
+ if (!new_value) {
+ XG(ide_key) = NULL;
+ } else {
+ XG(ide_key) = xdstrdup(new_value);
+ }
+ return SUCCESS;
+}
+
 static PHP_INI_MH(OnUpdateDebugMode)
 {
         if (!new_value) {
@@ -272,7 +285,7 @@
         STD_PHP_INI_ENTRY("xdebug.remote_port", "9000", PHP_INI_ALL, OnUpdateLong, remote_port, zend_xdebug_globals, xdebug_globals)
 #endif
         PHP_INI_ENTRY("xdebug.allowed_clients", "", PHP_INI_SYSTEM, OnUpdateAllowedClients)
- STD_PHP_INI_ENTRY("xdebug.idekey", "", PHP_INI_ALL, OnUpdateString, ide_key, zend_xdebug_globals, xdebug_globals)
+ PHP_INI_ENTRY("xdebug.idekey", "", PHP_INI_ALL, OnUpdateIDEKey)
 PHP_INI_END()
 
 static void php_xdebug_init_globals (zend_xdebug_globals *xg TSRMLS_DC)
@@ -490,7 +503,6 @@
         XG(do_code_coverage) = 0;
         XG(code_coverage) = xdebug_hash_alloc(32, xdebug_coverage_file_dtor);
         XG(stack) = xdebug_llist_alloc(stack_element_dtor);
- XG(ide_key) = NULL;
         XG(trace_file) = NULL;
         XG(tracefile_name) = NULL;
         XG(profile_file) = NULL;
@@ -499,6 +511,9 @@
         XG(function_count) = 0;
         
         if (idekey && *idekey) {
+ if (XG(ide_key)) {
+ xdfree(XG(ide_key));
+ }
                 XG(ide_key) = xdstrdup(idekey);
         }
 
Received on Thu Aug 05 2004 - 13:07:30 BST

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:02 BST