felipe          Wed May 13 02:14:53 2009 UTC

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

  Modified files:              
    /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/ext/dba/dba_db4.c?r1=1.15.2.3.2.1.2.3&r2=1.15.2.3.2.1.2.4&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.1.2.3 
php-src/ext/dba/dba_db4.c:1.15.2.3.2.1.2.4
--- php-src/ext/dba/dba_db4.c:1.15.2.3.2.1.2.3  Wed Dec 31 11:15:36 2008
+++ php-src/ext/dba/dba_db4.c   Wed May 13 02:14:53 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: dba_db4.c,v 1.15.2.3.2.1.2.3 2008/12/31 11:15:36 sebastian Exp $ */
+/* $Id: dba_db4.c,v 1.15.2.3.2.1.2.4 2009/05/13 02:14:53 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