php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #64263
Patch memtrack.c-path revision 2013-02-25 23:53 UTC by david at davidsteinsland dot net

Patch memtrack.c-path for memtrack Bug #64263

Patch version 2013-02-25 23:53 UTC

Return to Bug #64263 | Download this patch
Patch Revisions:

Developer: david@davidsteinsland.net

--- memtrack.c	Tue Sep 27 13:09:02 2011
+++ memtrack2.c	Tue Feb 26 00:41:42 2013
@@ -62,13 +62,15 @@
 
 static char *mt_get_function_name(zend_op_array *op_array TSRMLS_DC) /* {{{ */
 {
-	char *current_fname = NULL;
-	char *class_name, *fname;
+	const char *current_fname = NULL;
+	const char *class_name = NULL;
+	const char *fname = NULL;
 	zend_bool free_fname = 0;
-	int class_name_len, fname_len;
+	int class_name_len, 
+		fname_len;
 	zend_execute_data *exec_data = EG(current_execute_data);
 	zend_class_entry *ce;
-	char *space;
+	const char *space = NULL;
 	
 	if (op_array) {
 		ce = ((zend_function *)op_array)->common.scope;
@@ -99,7 +101,8 @@
 			memcpy(current_fname, class_name, class_name_len);
 			memcpy(current_fname + class_name_len, "::", 2);
 			memcpy(current_fname + class_name_len + 2, fname, fname_len);
-			current_fname[class_name_len + 2 + fname_len] = '\0';
+			memcpy(class_name_len + 2 + fname_len +1, '\0', 1);
+			//current_fname[class_name_len + 2 + fname_len] = '\0';
 		}
 	}
 
@@ -109,8 +112,8 @@
 
 	if (!free_fname && !strcmp("main", current_fname)) {
 
-		if (exec_data && exec_data->opline && exec_data->opline->op2.op_type == IS_UNUSED) {
-			switch (Z_LVAL(exec_data->opline->op2.u.constant)) {
+		if (exec_data && exec_data->opline && exec_data->opline->op2_type == IS_UNUSED) {
+			switch (exec_data->opline->extended_value) {
 				case ZEND_REQUIRE_ONCE:
 					current_fname = "require_once";
 					break;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 16:01:27 2024 UTC