diff options
author | Sean Finney <seanius@debian.org> | 2009-06-24 22:49:04 +0200 |
---|---|---|
committer | Sean Finney <seanius@debian.org> | 2009-06-24 22:49:04 +0200 |
commit | 84f4ca9b07fe5b73d840258f4aa7c1eb534c4253 (patch) | |
tree | 9829bd578af8a4a8b42b04277f9067e00dc5ad90 /ext/dba | |
parent | 6821b67124604da690c5e9276d5370d679c63ac8 (diff) | |
download | php-84f4ca9b07fe5b73d840258f4aa7c1eb534c4253.tar.gz |
Imported Upstream version 5.3.0~RC4upstream/5.3.0_RC4upstream/5.3.0.RC4
Diffstat (limited to 'ext/dba')
-rw-r--r-- | ext/dba/dba_db4.c | 4 | ||||
-rw-r--r-- | ext/dba/tests/bug48240.phpt | 25 | ||||
-rw-r--r-- | ext/dba/tests/dba_cdb_make.phpt | 3 |
3 files changed, 29 insertions, 3 deletions
diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c index 774bd1764..2c2da4052 100644 --- a/ext/dba/dba_db4.c +++ b/ext/dba/dba_db4.c @@ -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 @@ DBA_NEXTKEY_FUNC(db4) 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; diff --git a/ext/dba/tests/bug48240.phpt b/ext/dba/tests/bug48240.phpt new file mode 100644 index 000000000..72dc43956 --- /dev/null +++ b/ext/dba/tests/bug48240.phpt @@ -0,0 +1,25 @@ +--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=== diff --git a/ext/dba/tests/dba_cdb_make.phpt b/ext/dba/tests/dba_cdb_make.phpt index 04df9252d..bb41e82fb 100644 --- a/ext/dba/tests/dba_cdb_make.phpt +++ b/ext/dba/tests/dba_cdb_make.phpt @@ -33,6 +33,7 @@ magic_quotes_runtime=1 } ?> --EXPECT-- +PHP Warning: Directive 'magic_quotes_runtime' is deprecated in PHP 5.3 and greater in Unknown on line 0 database handler: cdb_make string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5" -string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"
\ No newline at end of file +string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5" |