cvs: php-src(PHP_5_2) /ext/dbase dbase.c /ext/dbase/tests 002.phpt

From: Date: Fri, 01 Dec 2006 19:10:50 +0000
Subject: cvs: php-src(PHP_5_2) /ext/dbase dbase.c /ext/dbase/tests 002.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-41820@lists.php.net to get a copy of this message
iliaa Fri Dec 1 19:10:50 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/dbase dbase.c /php-src/ext/dbase/tests 002.phpt Log: Fixed a possible memory corruption in dbase_open() with invalid open mode http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/dbase.c?r1=1.74.2.2.2.6&r2=1.74.2.2.2.7&diff_format=u Index: php-src/ext/dbase/dbase.c diff -u php-src/ext/dbase/dbase.c:1.74.2.2.2.6 php-src/ext/dbase/dbase.c:1.74.2.2.2.7 --- php-src/ext/dbase/dbase.c:1.74.2.2.2.6 Wed Nov 22 17:30:34 2006 +++ php-src/ext/dbase/dbase.c Fri Dec 1 19:10:49 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dbase.c,v 1.74.2.2.2.6 2006/11/22 17:30:34 iliaa Exp $ */ +/* $Id: dbase.c,v 1.74.2.2.2.7 2006/12/01 19:10:49 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -137,7 +137,7 @@ if (Z_LVAL_PP(options) == 1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot open %s in write-only mode", Z_STRVAL_PP(dbf_name)); RETURN_FALSE; - } else if (Z_LVAL_PP(options) < 0) { + } else if (Z_LVAL_PP(options) < 0 || Z_LVAL_PP(options) > 3) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid access mode %ld", Z_LVAL_PP(options)); RETURN_FALSE; } http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/tests/002.phpt?r1=1.1.2.4&r2=1.1.2.5&diff_format=u Index: php-src/ext/dbase/tests/002.phpt diff -u php-src/ext/dbase/tests/002.phpt:1.1.2.4 php-src/ext/dbase/tests/002.phpt:1.1.2.5 --- php-src/ext/dbase/tests/002.phpt:1.1.2.4 Sun Nov 26 16:29:42 2006 +++ php-src/ext/dbase/tests/002.phpt Fri Dec 1 19:10:50 2006 @@ -38,7 +38,7 @@ Warning: dbase_open(): Invalid access mode -1 in %s on line %d bool(false) -Warning: dbase_open(): unable to open database %s in %s on line %d +Warning: dbase_open(): Invalid access mode 1000 in %s on line %d bool(false) Warning: dbase_open(): unable to open database %s in %s on line %d

« previous php.cvs (#41820) next »