diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2006-12-01 19:10:50 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2006-12-01 19:10:50 +0000 |
| commit | b3004fb883d44efc28207289e914794ffd7a0649 (patch) | |
| tree | 6ce7eefa2cc4faa375edc91c5ac7d507b0622bfc /ext/dbase | |
| parent | e65bdffab503c973319c2cb460b782f3f2628752 (diff) | |
| download | php-git-b3004fb883d44efc28207289e914794ffd7a0649.tar.gz | |
Fixed a possible memory corruption in dbase_open() with invalid open mode
Diffstat (limited to 'ext/dbase')
| -rw-r--r-- | ext/dbase/dbase.c | 2 | ||||
| -rw-r--r-- | ext/dbase/tests/002.phpt | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/dbase/dbase.c b/ext/dbase/dbase.c index 1567d7e921..ce28fceb56 100644 --- a/ext/dbase/dbase.c +++ b/ext/dbase/dbase.c @@ -137,7 +137,7 @@ 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) { + } 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; } diff --git a/ext/dbase/tests/002.phpt b/ext/dbase/tests/002.phpt index 90ec858864..d5dd5c9e02 100644 --- a/ext/dbase/tests/002.phpt +++ b/ext/dbase/tests/002.phpt @@ -38,7 +38,7 @@ echo "Done\n"; 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 |
