cvs: php-src /ext/dbase dbase.c
| From: | Ilia Alshanetsky | Date: | Wed, 22 Nov 2006 17:30:52 +0000 |
| Subject: | cvs: php-src /ext/dbase dbase.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-41688@lists.php.net to get a copy of this message | ||
iliaa Wed Nov 22 17:30:52 2006 UTC
Modified files:
/php-src/ext/dbase dbase.c
Log:
MFB: Fixed a possible crash in dbase_open() on empty filename.
http://cvs.php.net/viewvc.cgi/php-src/ext/dbase/dbase.c?r1=1.84&r2=1.85&diff_format=u
Index: php-src/ext/dbase/dbase.c
diff -u php-src/ext/dbase/dbase.c:1.84 php-src/ext/dbase/dbase.c:1.85
--- php-src/ext/dbase/dbase.c:1.84 Tue Oct 10 23:00:48 2006
+++ php-src/ext/dbase/dbase.c Wed Nov 22 17:30:52 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbase.c,v 1.84 2006/10/10 23:00:48 tony2001 Exp $ */
+/* $Id: dbase.c,v 1.85 2006/11/22 17:30:52 iliaa Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -128,6 +128,11 @@
convert_to_string_ex(dbf_name);
convert_to_long_ex(options);
+ if (!Z_STRLEN_PP(dbf_name)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The filename cannot be empty.");
+ RETURN_FALSE;
+ }
+
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;