cvs: pecl /bcompiler bcompiler.c
| From: | val khokhlov | Date: | Thu, 31 Mar 2005 18:26:15 +0000 |
| Subject: | cvs: pecl /bcompiler bcompiler.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-2917@lists.php.net to get a copy of this message | ||
val Thu Mar 31 13:26:15 2005 EDT
Modified files:
/pecl/bcompiler bcompiler.c
Log:
fix a crash when filename field is NULL in zend_class_entry
http://cvs.php.net/diff.php/pecl/bcompiler/bcompiler.c?r1=1.82&r2=1.83&ty=u
Index: pecl/bcompiler/bcompiler.c
diff -u pecl/bcompiler/bcompiler.c:1.82 pecl/bcompiler/bcompiler.c:1.83
--- pecl/bcompiler/bcompiler.c:1.82 Sun Mar 27 14:31:41 2005
+++ pecl/bcompiler/bcompiler.c Thu Mar 31 13:26:13 2005
@@ -20,7 +20,7 @@
| Mike Bretz <mike@metropolis-ag.de> |
+----------------------------------------------------------------------+
*/
-/* $Id: bcompiler.c,v 1.82 2005/03/27 19:31:41 val Exp $ */
+/* $Id: bcompiler.c,v 1.83 2005/03/31 18:26:13 val Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -891,7 +891,7 @@
#ifndef ZEND_ENGINE_2
if (i > n_old_class)
#else
- if (strcmp(zc->filename, real_path) == 0)
+ if (zc->filename && strcmp(zc->filename, real_path) == 0)
#endif
{
SERIALIZE_SCALAR(BCOMPILER_CLASS_ENTRY, char)
@@ -940,7 +940,7 @@
#ifndef ZEND_ENGINE_2
if (i > n_old_class)
#else
- if (strcmp(zc->filename, real_path) == 0)
+ if (zc->filename && strcmp(zc->filename, real_path) == 0)
#endif
{
zend_hash_del(CG(class_table), pos->arKey, pos->nKeyLength);
@@ -2831,11 +2831,11 @@
void apc_create_zend_class_entry(zend_class_entry** zce, char** key, int* key_len TSRMLS_DC)
{
-
+
*zce = (zend_class_entry*) emalloc(sizeof(zend_class_entry));
- memset(*zce, 0, sizeof(**zce));
+ memset(*zce, 0, sizeof(**zce));
apc_deserialize_zend_class_entry(*zce, key, key_len TSRMLS_CC);
-
+
}