felipe Wed May 13 02:14:18 2009 UTC
Added files:
/php-src/ext/dba/tests bug48240.phpt
Modified files:
/php-src/ext/dba dba_db4.c
Log:
- Fixed bug #48240 (DBA Segmentation fault dba_nextkey)
http://cvs.php.net/viewvc.cgi/php-src/ext/dba/dba_db4.c?r1=1.23&r2=1.24&diff_format=u
Index: php-src/ext/dba/dba_db4.c
diff -u php-src/ext/dba/dba_db4.c:1.23 php-src/ext/dba/dba_db4.c:1.24
--- php-src/ext/dba/dba_db4.c:1.23 Tue Mar 10 23:39:12 2009
+++ php-src/ext/dba/dba_db4.c Wed May 13 02:14:18 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_db4.c,v 1.23 2009/03/10 23:39:12 helly Exp $ */
+/* $Id: dba_db4.c,v 1.24 2009/05/13 02:14:18 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