iliaa           Fri Dec  1 19:10:59 2006 UTC

  Modified files:              
    /php-src/ext/dbase  dbase.c 
    /php-src/ext/dbase/tests    002.phpt 
  Log:
  MFB: 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.85&r2=1.86&diff_format=u
Index: php-src/ext/dbase/dbase.c
diff -u php-src/ext/dbase/dbase.c:1.85 php-src/ext/dbase/dbase.c:1.86
--- php-src/ext/dbase/dbase.c:1.85      Wed Nov 22 17:30:52 2006
+++ php-src/ext/dbase/dbase.c   Fri Dec  1 19:10:59 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: dbase.c,v 1.85 2006/11/22 17:30:52 iliaa Exp $ */
+/* $Id: dbase.c,v 1.86 2006/12/01 19:10:59 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -136,7 +136,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.3&r2=1.4&diff_format=u
Index: php-src/ext/dbase/tests/002.phpt
diff -u php-src/ext/dbase/tests/002.phpt:1.3 
php-src/ext/dbase/tests/002.phpt:1.4
--- php-src/ext/dbase/tests/002.phpt:1.3        Sun Nov 26 16:29:55 2006
+++ php-src/ext/dbase/tests/002.phpt    Fri Dec  1 19:10:59 2006
@@ -38,7 +38,7 @@
 Warning: dbase_open(): Invalid access mode -1 %s 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

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

Reply via email to