Changeset 289

Show
Ignore:
Timestamp:
02/13/07 15:57:18 (2 years ago)
Author:
bart
Message:

Fixed a nullpointer dereference in some special cases in ea_restore.c:509

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r288 r289  
    33        * Added a function to dump an eaccelerator class entry in debug.c 
    44        * Changed include order in mm.c because of eaccelerator.h include in debug.h  
     5        * Fixed a nullpointer dereference in some special cases in ea_restore.c:509 
    56 
    672007-01-29  Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
  • eaccelerator/trunk/ea_restore.c

    r286 r289  
    500500                char *from_scope_lc = zend_str_tolower_dup(from->scope_name, from->scope_name_len); 
    501501        scope.v = to->scope; 
    502                 if (zend_hash_find (CG(class_table), (void *) from_scope_lc, from->scope_name_len + 1, &scope.ptr) != SUCCESS) { 
    503                         DBG(ea_debug_pad, (EA_DEBUG TSRMLS_CC)); 
    504                         DBG(ea_debug_printf, (EA_DEBUG, "[%d]                   can't find '%s' in class_table. use EAG(class_entry).\n", getpid(), from->scope_name)); 
    505                         to->scope = EAG(class_entry); 
    506                 } else { 
     502                if (zend_hash_find (CG(class_table), (void *) from_scope_lc, from->scope_name_len + 1, &scope.ptr) == SUCCESS && 
     503                to->scope != NULL) { 
    507504                        DBG(ea_debug_pad, (EA_DEBUG TSRMLS_CC)); 
    508505                        DBG(ea_debug_printf, (EA_DEBUG, "[%d]                   found '%s' in hash\n", getpid(), from->scope_name)); 
     506            DBG(ea_debug_printf, (EA_DEBUG, "name=%s :: to->scope is 0x%x", to->function_name, (unsigned int) to->scope)); 
    509507                        to->scope = *(zend_class_entry **) to->scope; 
    510                 } 
     508                } else { 
     509            DBG(ea_debug_pad, (EA_DEBUG TSRMLS_CC)); 
     510            DBG(ea_debug_printf, (EA_DEBUG, "[%d]                   can't find '%s' in class_table. use EAG(class_entry).\n", getpid(), from->scope_name)); 
     511            to->scope = EAG(class_entry); 
     512        } 
    511513                efree(from_scope_lc); 
    512         } else {                                       // zoeloelip: is this needed? scope is always stored -> hra: no its not :P only if from->scope!=null in ea_store 
    513                DBG(ea_debug_pad, (EA_DEBUG TSRMLS_CC)); 
     514        } else { 
     515        DBG(ea_debug_pad, (EA_DEBUG TSRMLS_CC)); 
    514516                DBG(ea_debug_printf, (EA_DEBUG, "[%d]                   from is NULL\n", getpid())); 
    515517                if (EAG(class_entry)) {