cvs: ZendEngine2(PHP_5_3) / zend_vm_def.h zend_vm_execute.h /tests bug46238.phpt php-src NEWS

[email protected] ("Felipe Pena")
Newsgroups php.zend-engine.cvs
Message-ID <cvsfelipe1223253605@cvsserver>
felipe		Mon Oct  6 00:40:05 2008 UTC

  Added files:                 (Branch: PHP_5_3)
    /ZendEngine2/tests	bug46238.phpt 

  Modified files:              
    /php-src	NEWS 
    /ZendEngine2	zend_vm_def.h zend_vm_execute.h 
  Log:
  - MFH: Fixed bug #46238 (Segmentation fault on static call with empty string method)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.340&r2=1.2027.2.547.2.965.2.341&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.340 php-src/NEWS:1.2027.2.547.2.965.2.341
--- php-src/NEWS:1.2027.2.547.2.965.2.340	Sun Oct  5 14:50:42 2008
+++ php-src/NEWS	Mon Oct  6 00:40:00 2008
@@ -13,6 +13,8 @@
 
 - Fixed bug causing the algorithm parameter of mhash() to be modified. (Scott)
 
+- Fixed bug #46238 (Segmentation fault on static call with empty string method).
+  (Felipe)
 - Fixed bug #46206 (pg_query_params/pg_execute convert passed values to
   strings). (Ilia) 
 - Fixed bug #46205 (Closure - Memory leaks when ReflectionException is thrown).
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.59.2.29.2.48.2.70&r2=1.59.2.29.2.48.2.71&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.70 ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.71
--- ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.70	Fri Aug 15 19:47:28 2008
+++ ZendEngine2/zend_vm_def.h	Mon Oct  6 00:40:00 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_vm_def.h,v 1.59.2.29.2.48.2.70 2008/08/15 19:47:28 felipe Exp $ */
+/* $Id: zend_vm_def.h,v 1.59.2.29.2.48.2.71 2008/10/06 00:40:00 felipe Exp $ */
 
 /* If you change this file, please regenerate the zend_vm_execute.h and
  * zend_vm_opcodes.h files by running:
@@ -1983,7 +1983,7 @@
 		}
 	}
 	if(OP2_TYPE != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 		zend_free_op free_op2;
 
@@ -2001,7 +2001,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.62.2.30.2.49.2.70&r2=1.62.2.30.2.49.2.71&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.70 ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.71
--- ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.70	Fri Aug 15 19:47:28 2008
+++ ZendEngine2/zend_vm_execute.h	Mon Oct  6 00:40:00 2008
@@ -2630,7 +2630,7 @@
 		}
 	}
 	if(IS_CONST != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 
 
@@ -2648,7 +2648,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
@@ -3226,7 +3226,7 @@
 		}
 	}
 	if(IS_TMP_VAR != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 		zend_free_op free_op2;
 
@@ -3244,7 +3244,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
@@ -3702,7 +3702,7 @@
 		}
 	}
 	if(IS_VAR != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 		zend_free_op free_op2;
 
@@ -3720,7 +3720,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
@@ -3934,7 +3934,7 @@
 		}
 	}
 	if(IS_UNUSED != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 
 
@@ -3952,7 +3952,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
@@ -4378,7 +4378,7 @@
 		}
 	}
 	if(IS_CV != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 
 
@@ -4396,7 +4396,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
@@ -10371,7 +10371,7 @@
 		}
 	}
 	if(IS_CONST != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 
 
@@ -10389,7 +10389,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
@@ -12225,7 +12225,7 @@
 		}
 	}
 	if(IS_TMP_VAR != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 		zend_free_op free_op2;
 
@@ -12243,7 +12243,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
@@ -14059,7 +14059,7 @@
 		}
 	}
 	if(IS_VAR != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 		zend_free_op free_op2;
 
@@ -14077,7 +14077,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
@@ -14986,7 +14986,7 @@
 		}
 	}
 	if(IS_UNUSED != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 
 
@@ -15004,7 +15004,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {
@@ -16507,7 +16507,7 @@
 		}
 	}
 	if(IS_CV != IS_UNUSED) {
-		char *function_name_strval;
+		char *function_name_strval = NULL;
 		int function_name_strlen = 0;
 
 
@@ -16525,7 +16525,7 @@
  			}
 		}
 
-		if (function_name_strlen) {
+		if (function_name_strval) {
 			if (ce->get_static_method) {
 				EX(fbc) = ce->get_static_method(ce, function_name_strval, function_name_strlen TSRMLS_CC);
 			} else {

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug46238.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug46238.phpt
+++ ZendEngine2/tests/bug46238.phpt
--TEST--
Bug #46238 (Segmentation fault on static call with empty string method)
--FILE--
<?php

class a {
        static function __callStatic($name, $arguments)
        {
                var_dump(array($name, $arguments));
        }
}

$a = 'a';
$b = '';

$a::$b($a);
$a::$b(array());
$a::$b(NULL);
$a::$b(1);
$a::$b();


$b = "\0";

$a::$b($a);
$a::$b(array());
$a::$b(NULL);
$a::$b(1);
$a::$b();

?>
--EXPECT--
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(1) {
    [0]=>
    unicode(1) "a"
  }
}
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(1) {
    [0]=>
    array(0) {
    }
  }
}
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(1) {
    [0]=>
    NULL
  }
}
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(1) {
    [0]=>
    int(1)
  }
}
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(0) {
  }
}
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(1) {
    [0]=>
    unicode(1) "a"
  }
}
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(1) {
    [0]=>
    array(0) {
    }
  }
}
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(1) {
    [0]=>
    NULL
  }
}
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(1) {
    [0]=>
    int(1)
  }
}
array(2) {
  [0]=>
  unicode(0) ""
  [1]=>
  array(0) {
  }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.