Browse Source

Fixed a possible crash in dbase_open() on empty filename.

experimental/5.2-WITH_DRCP
Ilia Alshanetsky 20 years ago
parent
commit
e8180067b9
  1. 5
      ext/dbase/dbase.c

5
ext/dbase/dbase.c

@ -129,6 +129,11 @@ PHP_FUNCTION(dbase_open)
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;

Loading…
Cancel
Save