Opened 14 years ago

Closed 8 years ago

#37 closed defect (fixed)

xcache_get SEGV using objects

Reported by: judas_iscariote Owned by: moo
Priority: major Milestone: 3.0.0
Component: cacher Version: 1.0.1
Keywords: xcache_set objects Cc: soporte@…
Application: PHP Version:
Other Exts: SAPI: Irrelevant
Probability: Blocked By:


PHP 5.1.6 xcache_get SEGV with objects.

//php built in stdClass
xcache_set("foo" , new stdClass);


well, I expect either and error if objects are not supported, or the actual stored object var_dump'ed but not a segv :)

Change History (5)

comment:1 Changed 14 years ago by mOo

not supported yet. will be done when i find a easy way.

comment:2 Changed 14 years ago by judas_iscariote

--- xcache.c    (revisión: 199)
+++ xcache.c    (copia de trabajo)
@@ -1645,6 +1645,10 @@
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|l", &name, &value, &xce.ttl) == FAILURE) {
+       if (Z_TYPE_P(value) == IS_OBJECT) {
+           php_error_docref(NULL TSRMLS_CC, E_ERROR,"Objects cannot be stored in the variable cache");
+           return;
+       }

        /* max ttl */
        if (xc_var_maxttl && (!xce.ttl || xce.ttl > xc_var_maxttl)) {

ATM, crash can be avoided with something ugly like this. :)

comment:3 Changed 14 years ago by moo

  • Milestone changed from 1.0.3 to 1.2
  • Status changed from new to assigned

comment:4 Changed 13 years ago by moo

  • Milestone changed from 1.2 to 1.3.0

it's better to not coredump in 1.3 and store it in 2.0

comment:5 Changed 8 years ago by moo

  • pending set to 0
  • Resolution set to fixed
  • SAPI set to Irrelevant
  • Status changed from assigned to closed

fixed in [971]

Note: See TracTickets for help on using tickets.