felipe          Wed May 13 02:16:37 2009 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/dba/tests      bug48240.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/dba    dba_db4.c 
  Log:
  - MFH: Fixed bug #48240 (DBA Segmentation fault dba_nextkey)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1502&r2=1.2027.2.547.2.1503&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1502 php-src/NEWS:1.2027.2.547.2.1503
--- php-src/NEWS:1.2027.2.547.2.1502    Tue May 12 23:01:37 2009
+++ php-src/NEWS        Wed May 13 02:16:36 2009
@@ -14,6 +14,7 @@
 
 - Fixed bug #48248 (SIGSEGV when access to private property via &__get). 
   (Felipe)
+- Fixed bug #48240 (DBA Segmentation fault dba_nextkey). (Felipe)
 - Fixed bug #48224 (Incorrect shuffle in array_rand). (Etienne)
 - Fixed bug #48221 (memory leak when passing invalid xslt parameter). (Felipe)
 - Fixed bug #48206 (Iterating over an invalid data structure
http://cvs.php.net/viewvc.cgi/php-src/ext/dba/dba_db4.c?r1=1.15.2.3.2.4&r2=1.15.2.3.2.5&diff_format=u
Index: php-src/ext/dba/dba_db4.c
diff -u php-src/ext/dba/dba_db4.c:1.15.2.3.2.4 
php-src/ext/dba/dba_db4.c:1.15.2.3.2.5
--- php-src/ext/dba/dba_db4.c:1.15.2.3.2.4      Wed Dec 31 11:17:36 2008
+++ php-src/ext/dba/dba_db4.c   Wed May 13 02:16:36 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: dba_db4.c,v 1.15.2.3.2.4 2008/12/31 11:17:36 sebastian Exp $ */
+/* $Id: dba_db4.c,v 1.15.2.3.2.5 2009/05/13 02:16:36 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -219,7 +219,7 @@
                gkey.flags |= DB_DBT_MALLOC;
                gval.flags |= DB_DBT_MALLOC;
        }
-       if (dba->cursor->c_get(dba->cursor, &gkey, &gval, DB_NEXT) == 0) {
+       if (dba->cursor && dba->cursor->c_get(dba->cursor, &gkey, &gval, 
DB_NEXT) == 0) {
                if (gkey.data) {
                        nkey = estrndup(gkey.data, gkey.size);
                        if (newlen) *newlen = gkey.size;

http://cvs.php.net/viewvc.cgi/php-src/ext/dba/tests/bug48240.phpt?view=markup&rev=1.1
Index: php-src/ext/dba/tests/bug48240.phpt
+++ php-src/ext/dba/tests/bug48240.phpt
--TEST--
Bug #48240 (DBA Segmentation fault dba_nextkey)
--SKIPIF--
<?php 
        $handler = 'db4';
        require_once('skipif.inc');
?>
--FILE--
<?php

$handler = 'db4';
require_once('test.inc');

$db = dba_open($db_filename, 'c', 'db4');

var_dump(dba_nextkey($db));

dba_close($db);
unlink($db_filename);

?>
===DONE===
--EXPECT--
bool(false)
===DONE===



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to