Re: svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c trunk/ext/mysqlnd/mysqlnd_ps.c

From: Date: Tue, 18 Jan 2011 10:29:53 +0000
Subject: Re: svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c trunk/ext/mysqlnd/mysqlnd_ps.c
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-64377@lists.php.net to get a copy of this message
fixed On Tue, Jan 18, 2011 at 11:20 AM, Andrey Hristov <php@hristov.com> wrote: > On 01/17/2011 03:01 PM, Pierre Joye wrote: >> pajoye                                   Mon, 17 Jan 2011 14:01:01 +0000 >> >> Revision: >> http://svn.php.net/viewvc?view=revision&revision=307537 >> >> Log: >> - fix NULL derefencing >> >> Changed paths: >>     U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c >>     U   php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c >> >> Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c >> =================================================================== >> --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c     2011-01-17 13:44:54 UTC >> (rev 307536) >> +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c     2011-01-17 14:01:01 UTC >> (rev 307537) >> @@ -735,7 +735,7 @@ >> >>       DBG_ENTER("mysqlnd_fetch_stmt_row_buffered"); >>       *fetched_anything = FALSE; >> -     DBG_INF_FMT("stmt=%lu", stmt->stmt_id); >> +     DBG_INF_FMT("stmt=%lu", stmt != NULL ? stmt->stmt_id : 0L); >> >>       /* If we haven't read everything */ >>       if (set->data_cursor && >> @@ -2223,9 +2223,9 @@ >>  static enum_func_status >>  MYSQLND_METHOD(mysqlnd_stmt, dtor)(MYSQLND_STMT * const s, zend_bool implicit TSRMLS_DC) >>  { >> -     MYSQLND_STMT_DATA * stmt = s? s->data:NULL; >> +     MYSQLND_STMT_DATA * stmt = (s == NULL) ? s->data:NULL; >>       enum_func_status ret = FAIL; >> -     zend_bool persistent = s->persistent; >> +     zend_bool persistent = (s == NULL) ? s->persistent : 0; > > This breaks mysqlnd. Why? Because you turn around the meaning. s? means > s!=NULL and you change it to s==NULL but leave the rest of the ternary > intact. Did you run the tests, because 117 more failing test, out of > 432. This is hard to oversee if you run the test suite! > > Best, > Andrey > -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

« previous php.cvs (#64377) next »