From ff6207679631cf388e0aeed02f8fe4d1984bc547 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 10 Oct 2006 23:00:48 +0000 Subject: [PATCH] access mode for dbase_open() cannot be < 0 --- ext/dbase/dbase.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c index 4c9d6dea20..9afe7b0f9a 100644 --- a/ext/dbase/dbase.c +++ b/ext/dbase/dbase.c @@ -131,6 +131,9 @@ PHP_FUNCTION(dbase_open) 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) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid access mode %ld", Z_LVAL_PP(options)); + RETURN_FALSE; } if (php_check_open_basedir(Z_STRVAL_PP(dbf_name) TSRMLS_CC)) { -- 2.50.1