Compare commits

..
2 Commits
Author SHA1 Message Date
Johannes Schlüter be8864cc22 PHP 5.3.9 (re-tag after version no. fix) 2012-01-10 13:33:01 +00:00
Johannes Schlüter d0cc4a1cfc PHP 5.3.9 2012-01-10 11:25:30 +00:00
459 changed files with 86707 additions and 128733 deletions

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
define ____executor_globals
if basic_functions_module.zts
set $tsrm_ls = ts_resource_ex(0, 0)
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
set $eg = ((zend_executor_globals) (*((void ***) $tsrm_ls))[executor_globals_id-1])
set $cg = ((zend_compiler_globals) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
else
set $eg = executor_globals
set $cg = compiler_globals
-173
View File
@@ -1,173 +0,0 @@
ext/mysqlnd/mysqlnd.h ident
ext/simplexml/simplexml.c ident
ext/iconv/php_iconv.h ident
ext/posix/posix.c ident
ext/recode/recode.c ident
ext/skeleton/create_stubs ident
ext/phar/phar/pharcommand.inc ident
ext/phar/phar.c ident
ext/sysvmsg/sysvmsg.c ident
ext/enchant/enchant.c ident
ext/reflection/php_reflection.c ident
ext/oci8/oci8.c ident
ext/dba/libinifile/inifile.c ident
ext/dba/libflatfile/flatfile.c ident
ext/dba/libcdb/cdb_make.c ident
ext/dba/libcdb/cdb.c ident
ext/filter/filter.c ident
README.input_filter ident
run-tests.php ident
sapi/nsapi/nsapi.c ident
sapi/continuity/capi.c ident
Zend/RFCs/002.txt ident
Zend/RFCs/003.txt ident
NEWS merge=NEWS
/ext/bz2/tests/005.phpt -crlf
/ext/dom/tests/dom005.phpt -crlf
/ext/dom/tests/DOMImplementation_createDocumentType_basic.phpt -crlf
/ext/ereg/tests/009.phpt -crlf
/ext/iconv/tests/eucjp2sjis.phpt -crlf
/ext/iconv/tests/eucjp2utf8.phpt -crlf
/ext/iconv/tests/iconv_stream_filter_delimiter.phpt -crlf
/ext/iconv/tests/iconv_stream_filter.phpt -crlf
/ext/mbstring/tests/mb_split-compat-01.phpt -crlf
/ext/phar/tests/005.phpt -crlf
/ext/phar/tests/phar_commitwrite.phpt -crlf
/ext/phar/tests/phar_create_in_cwd.phpt -crlf
/ext/phar/tests/phar_mount.phpt -crlf
/ext/reflection/tests/009.phpt -crlf
/ext/reflection/tests/025.phpt -crlf
/ext/standard/tests/general_functions/highlight_heredoc.phpt -crlf
/ext/standard/tests/general_functions/parse_ini_file.phpt -crlf
/ext/standard/tests/general_functions/parse_ini_string_002.phpt -crlf
/ext/standard/tests/strings/006.phpt -crlf
/ext/standard/tests/strings/addslashes_variation2.phpt -crlf
/ext/standard/tests/strings/addslashes_variation3.phpt -crlf
/ext/standard/tests/strings/bug21453.phpt -crlf
/ext/standard/tests/strings/chop_variation3.phpt -crlf
/ext/standard/tests/strings/chunk_split_variation11.phpt -crlf
/ext/standard/tests/strings/chunk_split_variation12.phpt -crlf
/ext/standard/tests/strings/chunk_split_variation4.phpt -crlf
/ext/standard/tests/strings/crc32_variation2.phpt -crlf
/ext/standard/tests/strings/crc32_variation3.phpt -crlf
/ext/standard/tests/strings/crc32_variation4.phpt -crlf
/ext/standard/tests/strings/highlight_file.phpt -crlf
/ext/standard/tests/strings/htmlentities_html4.phpt -crlf
/ext/standard/tests/strings/lcfirst.phpt -crlf
/ext/standard/tests/strings/ltrim.phpt -crlf
/ext/standard/tests/strings/nl2br_variation2.phpt -crlf
/ext/standard/tests/strings/php_strip_whitespace.phpt -crlf
/ext/standard/tests/strings/rtrim.phpt -crlf
/ext/standard/tests/strings/sprintf_f_2.phpt -crlf
/ext/standard/tests/strings/sprintf_variation15.phpt -crlf
/ext/standard/tests/strings/strcspn_variation6.phpt -crlf
/ext/standard/tests/strings/strcspn_variation7.phpt -crlf
/ext/standard/tests/strings/strcspn_variation8.phpt -crlf
/ext/standard/tests/strings/stripos_variation1.phpt -crlf
/ext/standard/tests/strings/stripos_variation3.phpt -crlf
/ext/standard/tests/strings/stripos_variation4.phpt -crlf
/ext/standard/tests/strings/stripos_variation5.phpt -crlf
/ext/standard/tests/strings/stripos_variation6.phpt -crlf
/ext/standard/tests/strings/stripslashes_variation2.phpt -crlf
/ext/standard/tests/strings/stripslashes_variation3.phpt -crlf
/ext/standard/tests/strings/stripslashes_variation4.phpt -crlf
/ext/standard/tests/strings/stripslashes_variation5.phpt -crlf
/ext/standard/tests/strings/str_ireplace.phpt -crlf
/ext/standard/tests/strings/strnatcmp_basic.phpt -crlf
/ext/standard/tests/strings/strncasecmp_variation9.phpt -crlf
/ext/standard/tests/strings/strpos.phpt -crlf
/ext/standard/tests/strings/strrchr_variation1.phpt -crlf
/ext/standard/tests/strings/strrchr_variation2.phpt -crlf
/ext/standard/tests/strings/strrchr_variation3.phpt -crlf
/ext/standard/tests/strings/strrchr_variation4.phpt -crlf
/ext/standard/tests/strings/strrchr_variation6.phpt -crlf
/ext/standard/tests/strings/strrchr_variation7.phpt -crlf
/ext/standard/tests/strings/str_replace.phpt -crlf
/ext/standard/tests/strings/strrev_variation3.phpt -crlf
/ext/standard/tests/strings/strrev_variation4.phpt -crlf
/ext/standard/tests/strings/strripos_variation1.phpt -crlf
/ext/standard/tests/strings/strripos_variation2.phpt -crlf
/ext/standard/tests/strings/strripos_variation3.phpt -crlf
/ext/standard/tests/strings/strripos_variation4.phpt -crlf
/ext/standard/tests/strings/strripos_variation5.phpt -crlf
/ext/standard/tests/strings/strrpos_variation1.phpt -crlf
/ext/standard/tests/strings/strrpos_variation2.phpt -crlf
/ext/standard/tests/strings/strrpos_variation3.phpt -crlf
/ext/standard/tests/strings/strrpos_variation4.phpt -crlf
/ext/standard/tests/strings/strrpos_variation5.phpt -crlf
/ext/standard/tests/strings/strrpos_variation6.phpt -crlf
/ext/standard/tests/strings/strspn_variation5.phpt -crlf
/ext/standard/tests/strings/strspn_variation6.phpt -crlf
/ext/standard/tests/strings/strspn_variation7.phpt -crlf
/ext/standard/tests/strings/strspn_variation8.phpt -crlf
/ext/standard/tests/strings/strstr.phpt -crlf
/ext/standard/tests/strings/strtok_variation1.phpt -crlf
/ext/standard/tests/strings/strtok_variation3.phpt -crlf
/ext/standard/tests/strings/strtr_variation1.phpt -crlf
/ext/standard/tests/strings/strtr_variation2.phpt -crlf
/ext/standard/tests/strings/str_word_count.phpt -crlf
/ext/standard/tests/strings/trim1.phpt -crlf
/ext/standard/tests/strings/ucfirst.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation10.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation12.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation16.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation18.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation4.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation6.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation7.phpt -crlf
/ext/standard/tests/strings/vfprintf_variation8.phpt -crlf
/ext/standard/tests/strings/vprintf_variation10.phpt -crlf
/ext/standard/tests/strings/vprintf_variation12.phpt -crlf
/ext/standard/tests/strings/vprintf_variation14.phpt -crlf
/ext/standard/tests/strings/vprintf_variation18.phpt -crlf
/ext/standard/tests/strings/vprintf_variation4.phpt -crlf
/ext/standard/tests/strings/vprintf_variation6.phpt -crlf
/ext/standard/tests/strings/vprintf_variation7.phpt -crlf
/ext/standard/tests/strings/vprintf_variation8.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation10.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation12.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation14.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation16.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation4.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation6.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation7.phpt -crlf
/ext/standard/tests/strings/vsprintf_variation8.phpt -crlf
/ext/standard/tests/strings/wordwrap.phpt -crlf
/ext/tidy/tests/010.phpt -crlf
/ext/tidy/tests/012.phpt -crlf
/ext/tidy/tests/025.phpt -crlf
/ext/tidy/tests/030.phpt -crlf
/ext/tokenizer/tests/bug26463.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation12.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation13.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation14.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation15.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation16.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation17.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation18.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation19.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation4.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation5.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation6.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation7.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation8.phpt -crlf
/ext/tokenizer/tests/token_get_all_variation9.phpt -crlf
/ext/xml/tests/bug26614_libxml.phpt -crlf
/ext/xmlwriter/tests/004.phpt -crlf
/ext/xmlwriter/tests/OO_004.phpt -crlf
/ext/zlib/tests/005.phpt -crlf
/ext/zlib/tests/gzfile_basic2.phpt -crlf
/ext/zlib/tests/gzfile_basic.phpt -crlf
/ext/zlib/tests/gzfilegzreadfile.phpt -crlf
/ext/zlib/tests/readgzfile_basic2.phpt -crlf
/ext/zlib/tests/readgzfile_basic.phpt -crlf
/sapi/cli/tests/014.phpt -crlf
/tests/run-test/test010.phpt -crlf
/Zend/tests/bug35655.phpt -crlf
/Zend/tests/bug48930.phpt -crlf
/Zend/tests/bug61095.phpt -crlf
/Zend/tests/heredoc_017.phpt -crlf
/Zend/tests/heredoc_018.phpt -crlf
/Zend/tests/nowdoc_013.phpt -crlf
/Zend/tests/nowdoc_014.phpt -crlf
/Zend/tests/nowdoc_015.phpt -crlf
-254
View File
@@ -1,254 +0,0 @@
# General Ignores
*~
.#*
*.
*.slo
*.mk
*.mem
*.gcda
*.gcno
*.la
*.lo
*.o
*.a
*.ncb
*.opt
*.plg
*swp
*.patch
*.tgz
*.tar.gz
*.tar.bz2
.FBCIndex
.FBCLockFolder
.deps
.libs
phpt.*
core
dynlib.m4
Debug
Debug_TS
Makefile
Makefile.fragments
Makefile.objects
Release
Release_TS
Release_TSDbg
Release_TS_inline
Release_inline
ZendEngine1
_libs
acconfig.h
aclocal.m4
autom4te.cache
bsd_converted
buildconf.stamp
buildmk.stamp
confdefs.h
config.h
config.guess
config.cache
config.h.in
config.log
config.nice
config.nice.bat
config.status
config.sub
config_vars.mk
configuration-parser.c
configuration-parser.h
configuration-parser.output
configuration-scanner.c
configure
configure.bat
configure.js
conftest
conftest.c
debug.log
diff
generated_lists
include
install-sh
internal_functions.c
lcov_data
lcov_html
libs
libtool
meta_cc
meta_ccld
missing
mkinstalldirs
modules
php
php-*.tar.gz
php5.spec
php_lcov.info
php_test_results_*.txt
php_version.h
results.txt
shlibtool
stamp-h
test.php3
tmp-php.ini
want_dependencies
x64
stamp-h.in
scan_makefile_in.awk
TSRM/tsrm_config.h
Zend/zend_config.h
Zend/zend_ini_parser.c
Zend/zend_ini_parser.h
Zend/zend_ini_parser.output
Zend/zend_language_parser.c
Zend/zend_language_parser.h
Zend/zend_language_parser.output
ext/date/lib/timelib_config.h
ext/iconv/php_iconv_aliased_libiconv.h
ext/phar/phar.php
main/php_config.h
main/php_config.h.in
# Test specific Ignores
tests/*/*.diff
tests/*/*.out
tests/*/*.php
tests/*/*.exp
tests/*/*.log
tests/*/*.sh
*/tests/*.diff
*/tests/*.out
*/tests/*.php
*/tests/*.exp
*/tests/*.log
*/tests/*.sh
*/tests/*/*.diff
*/tests/*/*.out
*/tests/*/*.php
*/tests/*/*.exp
*/tests/*/*.log
*/tests/*/*.sh
*/*/tests/*.diff
*/*/tests/*.out
*/*/tests/*.php
*/*/tests/*.exp
*/*/tests/*.log
*/*/tests/*.sh
*/*/tests/*/*.diff
*/*/tests/*/*.out
*/*/tests/*/*.php
*/*/tests/*/*.exp
*/*/tests/*/*.log
*/*/tests/*/*.sh
# Extension specifc ignores
ext/*/configure.in
ext/*/ltmain.sh
ext/*/libs.mk
ext/*/build
ext/*/scan_makefile_in.awk
ext/*/Makefile.global
ext/*/acinclude.m4
ext/*/config.sub
# Extension specific
ext/iconv/scan_makefile_in.awk
ext/iconv/php_have_bsd_iconv.h
ext/iconv/php_have_ibm_iconv.h
ext/iconv/php_have_libiconv.h
ext/iconv/php_php_iconv_h_path.h
ext/iconv/php_have_glibc_iconv.h
ext/iconv/php_php_iconv_impl.h
ext/iconv/php_have_iconv.h
ext/iconv/php_iconv_supports_errno.h
ext/mbstring/libmbfl/Makefile.in
ext/mbstring/libmbfl/autoscan.log
ext/mbstring/libmbfl/config.sub
ext/mbstring/libmbfl/depcomp
ext/mbstring/libmbfl/ltmain.sh
ext/mbstring/libmbfl/stamp-h1
ext/mbstring/libmbfl/*.dll
ext/mbstring/libmbfl/*.lib
ext/mbstring/libmbfl/*.RES
ext/mbstring/libmbfl/*.res
ext/mbstring/libmbfl/*.obj
ext/mbstring/libmbfl/*.tds
ext/mbstring/libmbfl/filters/Makefile.in
ext/mbstring/libmbfl/mbfl/Makefile.in
ext/mbstring/libmbfl/mbfl/EastAsianWidth.txt
ext/mbstring/libmbfl/nls/Makefile.in
ext/mssql/#*#
ext/mssql/Makefile.global
ext/mssql/acinclude.m4
ext/mssql/config.sub
ext/mssql/configure.in
ext/mssql/ltmain.sh
ext/mysql/weztest.sqlite
ext/oci8/tests/*.tmp
ext/oci8/tests/*.vglog
ext/pdo/conftest*
ext/pdo/tests/*.db
ext/pdo/tests/*.tmp
ext/pdo_firebird/conftest*
ext/pdo_mysql/conftest*
ext/pdo_mysql/tests/*.db
ext/pdo_mysql/tests/*.tmp
ext/pdo_oci/conftest*
ext/pdo_odbc/tests/*.db
ext/pdo_odbc/tests/*.tmp
ext/pdo_odbc/tests/*.mdb
ext/pdo_pgsql/conftest*
ext/pdo_pgsql/tests/*.db
ext/pdo_pgsql/tests/*.tmp
ext/pdo_sqlite/conftest*
ext/pdo_sqlite/sqlite3.h
ext/pdo_sqlite/tests/*.db
ext/pdo_sqlite/tests/*.tmp
ext/phar/phar.phar
ext/pspell/tests/*.tmp
ext/reflection/xml
ext/reflection/html
ext/reflection/spl.chm
ext/simplexml/examples/security.new.xml
ext/spl/examples/.htaccess
ext/spl/examples/*.phps
ext/sqlite/weztest.sqlite
ext/sqlite/libsqlite/src/sqlite.h
ext/sqlite/libsqlite/src/parse.out
ext/sqlite/libsqlite/src/libsqlite.dsw
ext/sqlite3/tests/phpsql*
ext/sqlite3/tests/*.db
ext/sqlite3/tests/*.tmp
ext/standard/tests/misc/*.txt
ext/standard/tests/strings/*.txt
main/build-defs.h
main/internal_functions_cli.c
main/config.w32.h
main/stamp-h1
main/streams/build-defs.h
main/streams/stamp-h1
pear/install-pear-nozlib.phar
pear/phpize
pear/run-tests
pear/php-config
pear/scripts
sapi/apache/libphp5.module
sapi/apache2handler/libphp5.module
sapi/apache_hooks/libphp5.module
sapi/cgi/php-cgi
sapi/cli/php.1
sapi/fpm/php-fpm
sapi/fpm/php-fpm.1
sapi/fpm/init.d.php-fpm
sapi/fpm/php-fpm.conf
sapi/fpm/fpm/php-cgi
scripts/php-config
scripts/phpize
scripts/man1/*.1
win32/*.suo
win32/*.aps
win32/*.positions
win32/ext
win32/phpts.def
win32/wsyslog.h
win32/win32.dsp
win32/php.dsw
+1 -2
View File
@@ -12,8 +12,7 @@ php_lcov.info: lcov-test
@rm -rf lcov_data/
@$(mkinstalldirs) lcov_data/
@echo
-@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | uniq` ;\
for x in $$files; do \
-@find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | uniq | while read x; do \
echo -n . ;\
y=`echo $$x | sed -e 's!\.libs/!!'`; \
dir=lcov_data/`dirname $$x`; \
+20 -251
View File
@@ -1,241 +1,10 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 Jun 2012, PHP 5.3.14
- CLI SAPI:
. Fixed bug #61546 (functions related to current script failed when chdir()
in cli sapi). (Laruence, reeze.xia@gmail.com)
- CURL:
. Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
(Laruence)
- COM:
. Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
- Core:
. Fixed CVE-2012-2143. (Solar Designer)
. Fixed bug #62005 (unexpected behavior when incrementally assigning to a
member of a null object). (Laruence)
. Fixed bug #61730 (Segfault from array_walk modifying an array passed by
reference). (Laruence)
. Fixed missing bound check in iptcparse(). (chris at chiappa.net)
. Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
. Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
set to null). (Anatoliy)
. Fixed bug #61713 (Logic error in charset detection for htmlentities).
(Anatoliy)
. Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
. Changed php://fd to be available only for CLI.
- Fileinfo:
. Fixed bug #61812 (Uninitialised value used in libmagic).
(Laruence, Gustavo)
- Iconv extension:
. Fixed a bug that iconv extension fails to link to the correct library
when another extension makes use of a library that links to the iconv
library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
(Moriyoshi)
- Intl:
. Fixed bug #62082 (Memory corruption in internal function
get_icu_disp_value_src_php()). (Gustavo)
- JSON
. Fixed bug #61537 (json_encode() incorrectly truncates/discards
information). (Adam)
- PDO:
. Fixed bug #61755 (A parsing bug in the prepared statements can lead to
access violations). (Johannes)
- Phar:
. Fix bug #61065 (Secunia SA44335). (Rasmus)
- Streams:
. Fixed bug #61961 (file_get_contents leaks when access empty file with
maxlen set). (Reeze)
08 May 2012, PHP 5.3.13
- CGI
. Improve fix for PHP-CGI query string parameter vulnerability, CVE-2012-2311.
(Stas)
03 May 2012, PHP 5.3.12
- Fix PHP-CGI query string parameter vulnerability, CVE-2012-1823. (Rasmus)
26 Apr 2012, PHP 5.3.11
- Core:
. Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
(without apache2)). (Laruence)
. Fixed bug #61273 (call_user_func_array with more than 16333 arguments
leaks / crashes). (Laruence)
. Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
. Improved max_input_vars directive to check nested variables (Dmitry).
. Fixed bug #61095 (Incorect lexing of 0x00*+<NUM>). (Etienne)
. Fixed bug #61087 (Memory leak in parse_ini_file when specifying
invalid scanner mode). (Nikic, Laruence)
. Fixed bug #61072 (Memory leak when restoring an exception handler).
(Nikic, Laruence)
. Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX).
(Laruence)
. Fixed bug #61043 (Regression in magic_quotes_gpc fix for CVE-2012-0831).
(Ondřej Surý)
. Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical
vars). (Laruence)
. Fixed bug #60895 (Possible invalid handler usage in windows random
functions). (Pierre)
. Fixed bug #60825 (Segfault when running symfony 2 tests).
(Dmitry, Laruence)
. Fixed bug #60801 (strpbrk() mishandles NUL byte). (Adam)
. Fixed bug #60569 (Nullbyte truncates Exception $message). (Ilia)
. Fixed bug #60227 (header() cannot detect the multi-line header with CR).
(rui, Gustavo)
. Fixed bug #60222 (time_nanosleep() does validate input params). (Ilia)
. Fixed bug #54374 (Insufficient validating of upload name leading to
corrupted $_FILES indices). (CVE-2012-1172). (Stas, lekensteyn at
gmail dot com, Pierre)
. Fixed bug #52719 (array_walk_recursive crashes if third param of the
function is by reference). (Nikita Popov)
. Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry)
- DOM
. Added debug info handler to DOM objects. (Gustavo, Joey Smith)
- FPM
. Fixed bug #61430 (Transposed memset() params in sapi/fpm/fpm/fpm_shm.c).
(michaelhood at gmail dot com, Ilia)
- Ibase
. Fixed bug #60947 (Segmentation fault while executing ibase_db_info).
(Ilia)
- Installation
. Fixed bug #61172 (Add Apache 2.4 support). (Chris Jones)
- Fileinfo
. Upgraded libmagic to 5.11 (Pierre, Anatoliy)
. Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a
directory descriptor under windows. (Anatoliy)
. Fixed bug #61566 failure caused by the posix lseek and read versions
under windows in cdf_read(). (Anatoliy)
. Fixed bug #61173 (Unable to detect error from finfo constructor). (Gustavo)
- Firebird Database extension (ibase):
. Fixed bug #60802 (ibase_trans() gives segfault when passing params).
- Libxml:
. Fixed bug #61367 (open_basedir bypass using libxml RSHUTDOWN).
(Tim Starling)
- mysqli
. Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes).
- PDO_mysql
. Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
always work). (Johannes)
. Fixed bug #61194 (PDO should export compression flag with myslqnd).
(Johannes)
- PDO_odbc
. Fixed bug #61212 (PDO ODBC Segfaults on SQL_SUCESS_WITH_INFO). (Ilia)
- PDO_pgsql
. Fixed bug #61267 (pdo_pgsql's PDO::exec() returns the number of SELECTed
rows on postgresql >= 9). (ben dot pineau at gmail dot com)
- PDO_Sqlite extension:
. Add createCollation support. (Damien)
- pgsql:
. Fixed bug #60718 (Compile problem with libpq (PostgreSQL 7.3 or less).
(Yasuo Ohgaki)
- Phar:
. Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
bytes). (Nikic)
- PHP-FPM SAPI:
. Fixed bug #60811 (php-fpm compilation problem). (rasmus)
- Readline:
. Fixed bug #61088 (Memory leak in readline_callback_handler_install).
(Nikic, Laruence)
. Add open_basedir checks to readline_write_history and readline_read_history.
(Rasmus, reported by Mateusz Goik)
- Reflection:
. Fixed bug #61388 (ReflectionObject:getProperties() issues invalid reads
when get_properties returns a hash table with (inaccessible) dynamic
numeric properties). (Gustavo)
. Fixed bug #60968 (Late static binding doesn't work with
ReflectionMethod::invokeArgs()). (Laruence)
- SOAP
. Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
. Fixed bug #60887 (SoapClient ignores user_agent option and sends no
User-Agent header). (carloschilazo at gmail dot com)
. Fixed bug #60842, #51775 (Chunked response parsing error when
chunksize length line is > 10 bytes). (Ilia)
. Fixed bug #49853 (Soap Client stream context header option ignored).
(Dmitry)
- SPL
. Fixed memory leak when calling SplFileInfo's constructor twice. (Felipe)
. Fixed bug #61418 (Segmentation fault when DirectoryIterator's or
FilesystemIterator's iterators are requested more than once without
having had its dtor callback called in between). (Gustavo)
. Fixed bug #61347 (inconsistent isset behavior of Arrayobject). (Laruence)
. Fixed bug #61326 (ArrayObject comparison). (Gustavo)
- SQLite3 extension:
. Add createCollation() method. (Brad Dewar)
- Session:
. Fixed bug #60860 (session.save_handler=user without defined function core
dumps). (Felipe)
. Fixed bug #60634 (Segmentation fault when trying to die() in
SessionHandler::write()). (Ilia)
- Streams:
. Fixed bug #61371 (stream_context_create() causes memory leaks on use
streams_socket_create). (Gustavo)
. Fixed bug #61253 (Wrappers opened with errors concurrency problem on ZTS).
(Gustavo)
. Fixed bug #61115 (stream related segfault on fatal error in
php_stream_context_link). (Gustavo)
. Fixed bug #60817 (stream_get_line() reads from stream even when there is
already sufficient data buffered). stream_get_line() now behaves more like
fgets(), as is documented. (Gustavo)
. Further fix for bug #60455 (stream_get_line misbehaves if EOF is not
detected together with the last read). (Gustavo)
. Fixed bug #60106 (stream_socket_server silently truncates long unix
socket paths). (Ilia)
- Tidy:
. Fixed bug #54682 (tidy null pointer dereference). (Tony, David Soria Parra)
- XMLRPC:
. Fixed bug #61264 (xmlrpc_parse_method_descriptions leaks temporary
variable). (Nikita Popov)
. Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikic)
- Zlib:
. Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikic)
02 Feb 2012, PHP 5.3.10
- Core:
. Fixed arbitrary remote code execution vulnerability reported by Stefan
Esser, CVE-2012-0830. (Stas, Dmitry)
10 Jan 2012, PHP 5.3.9
- Core:
. Added max_input_vars directive to prevent attacks based on hash collisions
(CVE-2011-4885) (Dmitry).
(Dmitry).
. Fixed bug #60205 (possible integer overflow in content_length). (Laruence)
. Fixed bug #60139 (Anonymous functions create cycles not detected by the
GC). (Dmitry)
@@ -314,7 +83,7 @@ PHP NEWS
- EXIF:
. Fixed bug #60150 (Integer overflow during the parsing of invalid exif
header). (CVE-2011-4566) (Stas, flolechaud at gmail dot com)
header). (Stas, flolechaud at gmail dot com)
- Fileinfo:
. Fixed bug #60094 (C++ comment fails in c89). (Laruence)
@@ -334,8 +103,6 @@ PHP NEWS
for small images). (Florian)
- Intl:
. Fixed bug #61487 (Incorrent bounds checking in grapheme_strpos).
(Stas)
. Fixed bug #60192 (SegFault when Collator not constructed
properly). (Florian)
. Fixed memory leak in several Intl locale functions. (Felipe)
@@ -406,35 +173,37 @@ PHP NEWS
- Phar:
. Fixed bug #60261 (NULL pointer dereference in phar). (Felipe)
. Fixed bug #60164 (Stubs of a specific length break phar_open_from_fp
scanning for __HALT_COMPILER). (Ralph Schindler)
. Fixed bug #53872 (internal corruption of phar). (Hannes)
. Fixed bug #52013 (Unable to decompress files in a compressed phar). (Hannes)
scanning for __HALT_COMPILER). (Ralph Schindler)
- PHP-FPM SAPI:
. Dropped restriction of not setting the same value multiple times, the last
one holds. (giovanni at giacobbi dot net, fat)
. Added .phar to default authorized extensions. (fat)
. Fixed bug #60659 (FPM does not clear auth_user on request accept).
(bonbons at linux-vserver dot org)
. Fixed bug #60629 (memory corruption when web server closed the fcgi fd).
(fat)
. Enhance error log when the primary script can't be open. FR #60199. (fat)
. Fixed bug #60179 (php_flag and php_value does not work properly). (fat)
. Fixed bug #55577 (status.html does not install). (fat)
. Fixed bug #55533 (The -d parameter doesn't work). (fat)
. Fixed bug #55526 (Heartbeat causes a lot of unnecessary events). (fat)
. Fixed bug #55533 (The -d parameter doesn't work). (fat)
. Implemented FR #52569 (Add the "ondemand" process-manager
to allow zero children). (fat)
. Fixed bug #55486 (status show BIG processes number). (fat)
. Enhanced security by limiting access to user defined extensions.
FR #55181. (fat)
. Added process.max to control the number of process FPM can fork. FR #55166.
(fat)
. Fixed bug #55577 (status.html does not install). (fat)
. Backported from 5.4 branch (Dropped restriction of not setting the same
value multiple times, the last one holds).
(giovanni at giacobbi dot net, fat)
. Backported FR #55166 from 5.4 branch (Added process.max to control
the number of process FPM can fork). (fat)
. Backported FR #55181 from 5.4 branch (Enhance security by limiting access
to user defined extensions). (fat)
. Backported FR #54098 from 5.4 branch (Lowered process manager
default value). (fat)
. Backported FR #52052 from 5.4 branch (Added partial syslog support). (fat)
. Implemented FR #54577 (Enhanced status page with full status and details
about each processes. Also provide a web page (status.html) for
real-time FPM status. (fat)
. Lowered default value for Process Manager. FR #54098. (fat)
. Implemented FR #52569 (Add the "ondemand" process-manager
to allow zero children). (fat)
. Added partial syslog support (on error_log only). FR #52052. (fat)
. Enhance error log when the primary script can't be open. FR #60199. (fat)
. Added .phar to default authorized extensions. (fat)
- Postgres:
. Fixed bug #60244 (pg_fetch_* functions do not validate that row param
@@ -976,7 +745,7 @@ PHP NEWS
- Tokenizer Extension
. Fixed bug #54089 (token_get_all() does not stop after __halt_compiler).
(Nikita Popov, Ilia)
(Ilia)
- XSL extension:
. Fixed memory leaked introduced by the NULL poisoning patch.
-124
View File
@@ -1,124 +0,0 @@
====================
Git Commit Rules
====================
This is the first file you should be reading when contributing code via Git.
We'll assume you're basically familiar with Git, but feel free to post
your questions on the mailing list. Please have a look at
http://git-scm.com/ for more detailed information on Git.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and Git lets us do this. Thus, following
some basic rules with regards to Git usage will::
a. Make everybody happier, especially those responsible for maintaining
Git itself.
b. Keep the changes consistently well documented and easily trackable.
c. Prevent some of those 'Oops' moments.
d. Increase the general level of good will on planet Earth.
Having said that, here are the organizational rules::
1. Respect other people working on the project.
2. Discuss any significant changes on the list before committing and get
confirmation from the release manager for the given branch.
3. Look at EXTENSIONS file to see who is the primary maintainer of
the code you want to contribute to.
4. If you "strongly disagree" about something another person did, don't
start fighting publicly - take it up in private email.
5. If you don't know how to do something, ask first!
6. Test your changes before committing them. We mean it. Really.
To do so use "make test".
7. For development use the --enable-maintainer-zts switch to ensure your
code handles TSRM correctly and doesn't break for those who need that.
Currently we have the following branches in use::
master The active development branch.
PHP-5.4 Is used to release the PHP 5.4.x series. It still allows for
larger enhancements.
PHP-5.3 Is used to release the PHP 5.3.x series. This is current
stable version and is open for bugfixes only.
PHP-5.2 Is used to release the PHP 5.2.x series. It is closed for
changes now.
PHP-5.1 This branch is closed.
PHP-4.4 This branch is closed.
The next few rules are more of a technical nature::
1. All changes should first go to the lowest branch (i.e. 5.3) and then
get merged up to all other branches. If a change is not needed for
later branches (i.e. fixes for features which where dropped from later
branches) an empty merge should be done.
2. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file of the
*first* to be released version with the given change. In other words
any NEWS file change only needs to done in one branch.
3. Do not commit multiple file and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
provide a nice commit message for each one. See example below.
4. Do write your commit message in such a way that it makes sense even
without the corresponding diff. One should be able to look at it, and
immediately know what was modified. Definitely include the function name
in the message as shown below.
5. In your commit messages, keep each line shorter than 80 characters. And
try to align your lines vertically, if they wrap. It looks bad otherwise.
6. If you modified a function that is callable from PHP, prepend PHP to
the function name as shown below.
The format of the commit messages is pretty simple.
<max 79 characters short description>\n
\n
<long description, 79 chars per line>
\n
An Example from the git project (commit 2b34e486bc):
pack-objects: Fix compilation with NO_PTHREDS
It looks like commit 99fb6e04 (pack-objects: convert to use
parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but
hasn't noticed that the 'arg' variable no longer is available.
If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
bug report when developers are browsing CVS via LXR or Bonsai.
Example::
Fixed bug #14016 (pgsql notice handler double free crash bug.)
When you change the NEWS file for a bug fix, then please keep the bugs
sorted in decreasing order under the fixed version.
You can use OpenGrok (http://lxr.php.net/) and gitweb (http://git.php.net/)
to look at PHP Git repository in various ways.
For further information on the process and further details please refer to
https://wiki.php.net/vcs/gitworkflow and https://wiki.php.net/vcs/gitfaq
Happy hacking,
PHP Team
+4 -4
View File
@@ -104,7 +104,7 @@ Derick) run the following commands for you:
``sudo -u ezmlm ezmlm-sub ~ezmlm/primary-qa-tester/mod moderator-email-address``
3. Update ``qa.git/include/release-qa.php`` with the appropriate information.
3. Update ``web/qa/trunk/include/release-qa.php`` with the appropriate information.
See the documentation within release-qa.php for more information, but all releases
and RCs are configured here. Only $QA_RELEASES needs to be edited.
@@ -113,15 +113,15 @@ Derick) run the following commands for you:
Note: Remember to update the MD5 checksum information.
4. Update ``php.git/include/version.inc`` (x=major version number)
4. Update ``web/php/trunk/include/version.inc`` (x=major version number)
a. ``$PHP_x_RC`` = "5.3.0RC1"
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
5. Commit and push those changes:
5. Commit those changes:
a. ``git commit -a && git push origin master``
a. ``svn commit web/qa/trunk web/php-bugs/trunk web/php/trunk``
6. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
+146
View File
@@ -0,0 +1,146 @@
====================
SVN Commit Rules
====================
This is the first file you should be reading after you get your SVN account.
We'll assume you're basically familiar with SVN, but feel free to post
your questions on the mailing list. Please have a look at
http://svnbook.red-bean.com/ for more detailed information on SVN.
PHP is developed through the efforts of a large number of people.
Collaboration is a Good Thing(tm), and SVN lets us do this. Thus, following
some basic rules with regards to SVN usage will::
a. Make everybody happier, especially those responsible for maintaining
the SVN itself.
b. Keep the changes consistently well documented and easily trackable.
c. Prevent some of those 'Oops' moments.
d. Increase the general level of good will on planet Earth.
Having said that, here are the organizational rules::
1. Respect other people working on the project.
2. Discuss any significant changes on the list before committing and get
confirmation from the release manager for the given branch.
3. Look at EXTENSIONS file to see who is the primary maintainer of
the code you want to contribute to.
4. If you "strongly disagree" about something another person did, don't
start fighting publicly - take it up in private email.
5. If you don't know how to do something, ask first!
6. Test your changes before committing them. We mean it. Really.
To do so use "make test".
7. For development use the --enable-maintainer-zts switch to ensure your
code handles TSRM correctly and doesn't break for those who need that.
Currently we have the following branches in use::
trunk Will become PHP 6.0. This CVS branch is for active development.
branches/PHP_5_3 Is used to release the PHP 5.3.x series. It still allows for
larger enhancements.
branches/PHP_5_2 Is used to release the PHP 5.2.x series. Only bugfixes are permitted
on this branch (Consult the releasemaster prior to commit).
branches/PHP_5_1 This branch is closed.
branches/PHP_4_4 This branch is closed.
The next few rules are more of a technical nature::
1. All changes should first go to trunk and then get merged from trunk
(aka MFH'ed) to all other relevant branches.
2. DO NOT TOUCH ChangeLog! It is automagically updated from the commit
messages every day. Woe be to those who attempt to mess with it.
3. All news updates intended for public viewing, such as new features,
bug fixes, improvements, etc., should go into the NEWS file of the
*first* to be released version with the given change. In other words
any NEWS file change only needs to done in one branch.
NB! Lines, starting with @ will go automagically into NEWS file, but
this is NOT recommended, though. Please, add news entries directly to
NEWS file and don't forget to keep them adjusted and sorted.
4. Do not commit multiple file and dump all messages in one commit. If you
modified several unrelated files, commit each group separately and
provide a nice commit message for each one. See example below.
5. Do write your commit message in such a way that it makes sense even
without the corresponding diff. One should be able to look at it, and
immediately know what was modified. Definitely include the function name
in the message as shown below.
6. In your commit messages, keep each line shorter than 80 characters. And
try to align your lines vertically, if they wrap. It looks bad otherwise.
7. If you modified a function that is callable from PHP, prepend PHP to
the function name as shown below.
The format of the commit messages is pretty simple.
Use a - to start a new item in your commit message.
If a line begins with #, it is taken to be a comment and will not appear
in the ChangeLog. Everything else goes into the ChangeLog.
It is important to note that if your comment or news logline spans multiple
lines, you have to put # at the beginning of **every** such line.
Example. Say you modified two files, datetime.c and string.c. In datetime.c you
added a new format option for the date() function, and in string.c you fixed a
memory leak in php_trim(). Don't commit both of these at once. Commit them
separately and try to make sure your commit messages look something like the
following.
For datetime.c::
- Added new 'K' format modifier to date() for printing out number of days
until New Year's Eve.
For string.c::
- Fixed a memory leak in php_trim() resulting from improper use of zval_dtor().
#- Man, that thing was leaking all over the place!
The # lines will be omitted from the ChangeLog automagically.
Use the [DOC] tag in your log message whenever you feel that your changes
imply a documentation modification. The php-doc team will automatically
get notified about your commit through the php-doc mailing list.
If you fix some bugs, you should note the bug ID numbers in your
commit message. Bug ID should be prefixed by "#" for easier access to
bug report when developers are browsing CVS via LXR or Bonsai.
Example::
Fixed bug #14016 (pgsql notice handler double free crash bug.)
If you don't see your messages in ChangeLog right away, don't worry!
These files are updated once a day, so your stuff will not show up until
somewhat later.
When you change the NEWS file for a bug fix, then please keep the bugs
sorted in decreasing order under the fixed version.
You can use LXR (http://lxr.php.net/) and Bonsai (http://bonsai.php.net/)
to look at PHP SVN repository in various ways.
To receive daily updates to ChangeLog and NEWS, send an empty message to
php-cvs-daily-subscribe@lists.php.net.
Happy hacking,
PHP Team
+112
View File
@@ -0,0 +1,112 @@
Using PHP 5 with the Zeus Web Server
-----------------------------------
Zeus fully supports running PHP in combination with our
webserver. There are three different interfaces that can be used to
enable PHP:
* CGI
* ISAPI
* FastCGI
Of the three, we recommend using FastCGI, which has been tested and
benchmarked as providing the best performance and reliability.
Full details of how to install PHP are available from our
website, at:
http://support.zeus.com/products/php.html
If you have any problems, please check the support site for more
up-to-date information and advice.
Quick guide to installing CGI/FastCGI with Zeus
-----------------------------------------------
Step 1 - Compile PHP as FastCGI.
Compile as follows:
./configure --enable-fastcgi
make
Note that PHP has many options to the configure script -
e.g. --with-mysql. You will probably want to select your usual options
before compiling; the above is just a bare minimum, for illustration.
After compilation finishes, you will be left with an executable
program called 'php'. Copy this into your document root, under a
dedicated FastCGI directory (e.g. $DOCROOT/fcgi-bin/php)
Step 2 - configure Zeus
Four stages:
- enable FastCGI
- configure FastCGI
- setup alias for FastCGI
- setup alias for PHP
1) Using the admin server, go to the 'module configuration' page for
your virtual server, and ensure that 'fastcgi' is enabled (select the
tickbox to the left).
2) While we can run FastCGI's locally, there are known problems with
some OS's (specifically, the communication between web server and
FastCGI happens over a unix domain socket, and some OS's have trouble
sustaining high connection rates over these sockets). So instead, we
are going to set up the PHP FastCGI to run 'remotely' over localhost
(this uses TCP sockets, which do not suffer this problem). Go to the
'fastcgi configuration' page, and under 'add remote fastcgi':
Add Remote FastCGI
Docroot path /fcgi-bin/php
Remote machine localhost:8002
The first entry is where you saved PHP, above.
The second entry is localhost:<any unused port>
We will start the FastCGI listening on this port shortly.
Click 'update' to commit these changes.
3) Go to the path mapping module and add an alias for FastCGI:
Add Alias
Docroot path /fcgi-bin
Filesystem directory /path/to/docroot/fcgi-bin
Alias type fastcgi
Click 'update' to commit these changes
4) Also on the path mapping module, add a handler for PHP:
Add handler
File extension php
Handler /fcgi-bin/php
Click 'update' to commit these changes
Finally restart your virtual server for these changes to take effect.
Step 3 - start PHP as a FastCGI runner
When you start PHP, it will pre-fork a given number of child processes
to handle incoming PHP requests. Each process will handle a given
number of requests before exiting (and being replaced by a newly
forked process). You can control these two parameters by setting the
following environment variables BEFORE starting the FastCGI runner:
PHP_FCGI_CHILDREN - the number of child processes to pre-fork. This
variable MUST be set, if not then the PHP will not run as a FastCGI.
We recommend a value of 8 for a fairly busy site. If you have many,
long-running PHP scripts, then you may need to increase this further.
PHP_FCGI_MAX_REQUESTS - the number of requests each PHP child process
handles before exiting. If not set, defaults to 500.
To start the FastCGI runner, execute '$ZEUSHOME/web/bin/fcgirunner
8002 $DOCROOT/fcgi-bin/php'. Substitute the appropriate values for
$ZEUSHOME and $DOCROOT; also substitute for 8002 the port you chose,
above.
To stop the runner (e.g. to experiment with the above environment
variables) you will need to manually stop and running PHP
processes. (Use 'ps' and 'kill'). As it is PHP which is forking lots
of children and not the runner, Zeus unfortunately cannot keep track
of what processes are running, sorry. A typical command line may look
like 'ps -efl | grep $DOCROOT/fcgi-bin/php | grep -v grep | awk
'{print $4}' | xargs kill'
+1 -1
View File
@@ -88,7 +88,7 @@ PHP_MINFO_FUNCTION(my_input_filter)
{
php_info_print_table_start();
php_info_print_table_row( 2, "My Input Filter Support", "enabled" );
php_info_print_table_row( 2, "Revision", "$Id$");
php_info_print_table_row( 2, "Revision", "$Revision$");
php_info_print_table_end();
}
+3 -15
View File
@@ -773,9 +773,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
while (1) {
if (len <= start) {
if (link_is_dir) {
*link_is_dir = 1;
}
return start;
}
@@ -792,10 +789,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
continue;
} else if (i == len - 2 && path[i] == '.' && path[i+1] == '.') {
/* remove '..' and previous directory */
is_dir = 1;
if (link_is_dir) {
*link_is_dir = 1;
}
if (i - 1 <= start) {
return start ? start : len;
}
@@ -1221,14 +1214,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
return 1;
}
memcpy(resolved_path, state->cwd, state_cwd_length);
if (resolved_path[state_cwd_length-1] == DEFAULT_SLASH) {
memcpy(resolved_path + state_cwd_length, path, path_length + 1);
path_length += state_cwd_length;
} else {
resolved_path[state_cwd_length] = DEFAULT_SLASH;
memcpy(resolved_path + state_cwd_length + 1, path, path_length + 1);
path_length += state_cwd_length + 1;
}
resolved_path[state_cwd_length] = DEFAULT_SLASH;
memcpy(resolved_path + state_cwd_length + 1, path, path_length + 1);
path_length += state_cwd_length + 1;
}
} else {
#ifdef TSRM_WIN32
-8
View File
@@ -24,14 +24,6 @@ Zend MM disabled:
$ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();'
Shared extensions:
------------------
Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so
that valgrind can correctly track the memory leaks in shared extensions. For
this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
DL_UNLOAD() is skipped during the shutdown of shared extensions.
Tweaking:
---------
+1 -1
View File
@@ -1,5 +1,5 @@
Title: Zend 2.0 Namespaces
Version: $Id$
Version: $Revision$
Status: declined
Maintainer: Stig S. Bakken <ssb@php.net>
Created: 2001-09-08
+1 -1
View File
@@ -1,5 +1,5 @@
Title: Loose type requirements for functions
Version: $Id$
Version: $Revision$
Status: draft
Maintainer: Brian Moon <brianm@dealnews.com>
Created: 2001-09-17
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
Bug #34199 (if($obj)/if(!$obj) inconsistency because of cast handler)
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip SimpleXML extension required"; ?>
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml = "<root></root>";
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
Bug #39602 (Invalid session.save_handler crashes PHP)
--SKIPIF--
<?php if (!extension_loaded("session")) die("skip session extension required"); ?>
<?php if (!extension_loaded("session")) die("skip"); ?>
--INI--
session.save_handler=qwerty
error_reporting=0
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
Bug #42819 (namespaces in indexes of constant arrays)
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip SPL extension required"; ?>
<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
<?php
namespace foo\foo;
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
Bug #43918 (Segmentation fault in garbage collector)
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip SimpleXML extension required"; ?>
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xmlstr = <<<XML
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
Bug #50174 (Incorrectly matched docComment)
--SKIPIF--
<?php if (!extension_loaded('reflection') || !extension_loaded('spl')) print "skip SPL and reflection extensions required"; ?>
<?php if (!extension_loaded('reflection') || !extension_loaded('spl')) print "skip"; ?>
--FILE--
<?php
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #60139 (Anonymous functions create cycles not detected by the GC)
--INI--
zend.enable_gc=1
--FILE--
<?php
class Foo {
Binary file not shown.
-9
View File
@@ -1,9 +0,0 @@
--TEST--
test of larger than 8kb text file being parsed by require statement
--FILE--
<?php
file_put_contents('test.php',str_repeat('passed, ',1024));
require('test.php');
?>
--EXPECT--
passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed, passed,Line truncated
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Bug #60825 (Segfault when running symfony 2 tests)
--DESCRIPTION--
run this with valgrind
--FILE--
<?php
class test {
public static $x;
public function __toString() {
self::$x = $this;
return __FILE__;
}
}
$a = new test;
require_once $a;
debug_zval_dump(test::$x);
?>
--EXPECTF--
string(%d) "%sbug60825.php" refcount(2)
-10
View File
@@ -1,10 +0,0 @@
--TEST--
Bug #61087 (Memory leak in parse_ini_file when specifying invalid scanner mode)
--FILE--
<?php
// the used file is actually irrelevant, so just use this file
// even though it's not an .ini
parse_ini_file(__FILE__, false, 100);
?>
--EXPECTF--
Warning: Invalid scanner mode in %s on line %d
-9
View File
@@ -1,9 +0,0 @@
--TEST--
Bug #61095 (Lexing 0x00*+<NUM> incorectly)
--FILE--
<?php
echo 0x00+2;
echo "\n";
?>
--EXPECT--
2
-28
View File
@@ -1,28 +0,0 @@
--TEST--
Bug #61165 (Segfault - strip_tags())
--FILE--
<?php
$handler = NULL;
class T {
public $_this;
public function __toString() {
global $handler;
$handler = $this;
$this->_this = $this; // <-- uncoment this
return 'A';
}
}
$t = new T;
for ($i = 0; $i < 3; $i++) {
strip_tags($t);
strip_tags(new T);
}
var_dump($handler);
--EXPECTF--
object(T)#%d (1) {
["_this"]=>
*RECURSION*
}
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Bug #61273 (call_user_func_array with more than 16333 arguments leaks / crashes)
--FILE--
<?php
/**
* for 5.3 #define ZEND_VM_STACK_PAGE_SIZE ((64 * 1024) - 64)
* for 5.4 #define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
* we should trick EG(argument_stack) into growing
*/
$args = array_fill(0, 64 * 1024 - 64, 0);
call_user_func_array(function(&$a) {}, $args);
echo strval("okey");
--EXPECTF--
Warning: Parameter 1 to {closure}() expected to be a reference, value given in %sbug61273.php on line %d
okey
-15
View File
@@ -1,15 +0,0 @@
--TEST--
Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
--FILE--
<?php
function add_points($player, $points) {
$player->energy += $points;
print_r($player);
}
add_points(NULL, 2);
--EXPECTF--
Strict Standards: Creating default object from empty value in %sbug62005.php on line %d
stdClass Object
(
[energy] => 2
)
+1 -1
View File
@@ -3,7 +3,7 @@ GC 024: GC and objects with non-standard handlers
--INI--
zend.enable_gc=1
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip SPL extension required"; ?>
<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
<?php
$a = new ArrayObject();
Binary file not shown.
+1 -1
View File
@@ -1,7 +1,7 @@
--TEST--
unset() CV 10 (unset() of global variable in ArrayObject::offsetUnset($GLOBALS))
--SKIPIF--
<?php if (!extension_loaded("spl")) print "skip SPL extension required"; ?>
<?php if (!extension_loaded("spl")) print "skip"; ?>
--FILE--
<?php
$a = new ArrayObject($GLOBALS);
+5 -8
View File
@@ -33,6 +33,7 @@
#endif
/* these variables are true statics/globals, and have to be mutex'ed on every access */
static int module_count=0;
ZEND_API HashTable module_registry;
/* this function doesn't check for too many parameters */
@@ -253,14 +254,10 @@ ZEND_API int zend_get_object_classname(const zval *object, char **class_name, ze
static int parse_arg_object_to_string(zval **arg TSRMLS_DC) /* {{{ */
{
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
zval *obj;
MAKE_STD_ZVAL(obj);
if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, IS_STRING TSRMLS_CC) == SUCCESS) {
zval_ptr_dtor(arg);
*arg = obj;
SEPARATE_ZVAL_IF_NOT_REF(arg);
if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING TSRMLS_CC) == SUCCESS) {
return SUCCESS;
}
efree(obj);
}
/* Standard PHP objects */
if (Z_OBJ_HT_PP(arg) == &std_object_handlers || !Z_OBJ_HANDLER_PP(arg, cast_object)) {
@@ -2137,7 +2134,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */
#if HAVE_LIBDL
#if !(defined(NETWARE) && defined(APACHE_1_BUILD))
if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) {
if (module->handle) {
DL_UNLOAD(module->handle);
}
#endif
@@ -2183,7 +2180,7 @@ int module_registry_unload_temp(const zend_module_entry *module TSRMLS_DC) /* {{
/* return the next free module number */
int zend_next_free_module(void) /* {{{ */
{
return zend_hash_num_elements(&module_registry) + 1;
return ++module_count;
}
/* }}} */
+2 -1
View File
@@ -1516,7 +1516,8 @@ ZEND_FUNCTION(set_exception_handler)
RETURN_TRUE;
}
MAKE_COPY_ZVAL(&exception_handler, EG(user_exception_handler))
*EG(user_exception_handler) = *exception_handler;
zval_copy_ctor(EG(user_exception_handler));
if (!had_orig_exception_handler) {
RETURN_NULL();
+1 -1
View File
@@ -192,7 +192,7 @@ ZEND_METHOD(exception, __construct)
object = getThis();
if (message) {
zend_update_property_stringl(default_exception_ce, object, "message", sizeof("message")-1, message, message_len TSRMLS_CC);
zend_update_property_string(default_exception_ce, object, "message", sizeof("message")-1, message TSRMLS_CC);
}
if (code) {
+2 -1
View File
@@ -432,10 +432,11 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC)
|| (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr) == 0)
|| (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)
) {
zend_error(E_STRICT, "Creating default object from empty value");
SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
zval_dtor(*object_ptr);
object_init(*object_ptr);
zend_error(E_STRICT, "Creating default object from empty value");
}
}
+1 -1
View File
@@ -877,7 +877,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (fci->no_separation &&
!ARG_MAY_BE_SENT_BY_REF(EX(function_state).function, i + 1)) {
if (i || UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == EG(argument_stack)->top)) {
if(i) {
/* hack to clean up the stack */
zend_vm_stack_push_nocheck((void *) (zend_uintptr_t)i TSRMLS_CC);
zend_vm_stack_clear_multiple(TSRMLS_C);
+116 -119
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Sat Feb 25 22:07:14 2012 */
/* Generated by re2c 0.13.5 on Fri Aug 26 18:01:17 2011 */
#line 1 "Zend/zend_ini_scanner.l"
/*
+----------------------------------------------------------------------+
@@ -230,12 +230,9 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRML
char *buf;
size_t size;
if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) {
return FAILURE;
}
if (init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE) {
zend_file_handle_dtor(fh TSRMLS_CC);
if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE ||
init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE
) {
return FAILURE;
}
@@ -333,7 +330,7 @@ restart:
}
}
#line 337 "Zend/zend_ini_scanner.c"
#line 334 "Zend/zend_ini_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -462,7 +459,7 @@ yy2:
yy3:
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 429 "Zend/zend_ini_scanner.l"
#line 426 "Zend/zend_ini_scanner.l"
{ /* Get option name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -472,7 +469,7 @@ yy3:
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
}
#line 476 "Zend/zend_ini_scanner.c"
#line 473 "Zend/zend_ini_scanner.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yyaccept = 0;
@@ -481,24 +478,24 @@ yy4:
yy5:
YYDEBUG(5, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 547 "Zend/zend_ini_scanner.l"
#line 544 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
#line 490 "Zend/zend_ini_scanner.c"
#line 487 "Zend/zend_ini_scanner.c"
yy6:
YYDEBUG(6, *YYCURSOR);
++YYCURSOR;
yy7:
YYDEBUG(7, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 552 "Zend/zend_ini_scanner.l"
#line 549 "Zend/zend_ini_scanner.l"
{
SCNG(lineno)++;
return END_OF_LINE;
}
#line 502 "Zend/zend_ini_scanner.c"
#line 499 "Zend/zend_ini_scanner.c"
yy8:
YYDEBUG(8, *YYCURSOR);
yych = *++YYCURSOR;
@@ -533,11 +530,11 @@ yy10:
++YYCURSOR;
YYDEBUG(11, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 475 "Zend/zend_ini_scanner.l"
#line 472 "Zend/zend_ini_scanner.l"
{ /* Disallow these chars outside option values */
return yytext[0];
}
#line 541 "Zend/zend_ini_scanner.c"
#line 538 "Zend/zend_ini_scanner.c"
yy12:
YYDEBUG(12, *YYCURSOR);
yyaccept = 1;
@@ -554,11 +551,11 @@ yy14:
goto yy54;
YYDEBUG(15, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 575 "Zend/zend_ini_scanner.l"
#line 572 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 562 "Zend/zend_ini_scanner.c"
#line 559 "Zend/zend_ini_scanner.c"
yy16:
YYDEBUG(16, *YYCURSOR);
++YYCURSOR;
@@ -567,7 +564,7 @@ yy16:
yy17:
YYDEBUG(17, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 439 "Zend/zend_ini_scanner.l"
#line 436 "Zend/zend_ini_scanner.l"
{ /* Start option value */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
yy_push_state(ST_RAW TSRMLS_CC);
@@ -576,7 +573,7 @@ yy17:
}
return '=';
}
#line 580 "Zend/zend_ini_scanner.c"
#line 577 "Zend/zend_ini_scanner.c"
yy18:
YYDEBUG(18, *YYCURSOR);
yych = *++YYCURSOR;
@@ -632,7 +629,7 @@ yy23:
++YYCURSOR;
YYDEBUG(24, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 358 "Zend/zend_ini_scanner.l"
#line 355 "Zend/zend_ini_scanner.l"
{ /* Section start */
/* Enter section data lookup state */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
@@ -642,7 +639,7 @@ yy23:
}
return TC_SECTION;
}
#line 646 "Zend/zend_ini_scanner.c"
#line 643 "Zend/zend_ini_scanner.c"
yy25:
YYDEBUG(25, *YYCURSOR);
++YYCURSOR;
@@ -672,7 +669,7 @@ yy28:
}
YYDEBUG(30, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 383 "Zend/zend_ini_scanner.l"
#line 380 "Zend/zend_ini_scanner.l"
{ /* Start of option with offset */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -685,7 +682,7 @@ yy28:
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
}
#line 689 "Zend/zend_ini_scanner.c"
#line 686 "Zend/zend_ini_scanner.c"
yy31:
YYDEBUG(31, *YYCURSOR);
++YYCURSOR;
@@ -733,11 +730,11 @@ yy31:
yy33:
YYDEBUG(33, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 421 "Zend/zend_ini_scanner.l"
#line 418 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
#line 741 "Zend/zend_ini_scanner.c"
#line 738 "Zend/zend_ini_scanner.c"
yy34:
YYDEBUG(34, *YYCURSOR);
++YYCURSOR;
@@ -807,11 +804,11 @@ yy39:
yy41:
YYDEBUG(41, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 425 "Zend/zend_ini_scanner.l"
#line 422 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
#line 815 "Zend/zend_ini_scanner.c"
#line 812 "Zend/zend_ini_scanner.c"
yy42:
YYDEBUG(42, *YYCURSOR);
++YYCURSOR;
@@ -926,13 +923,13 @@ yy55:
yy56:
YYDEBUG(56, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 557 "Zend/zend_ini_scanner.l"
#line 554 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 936 "Zend/zend_ini_scanner.c"
#line 933 "Zend/zend_ini_scanner.c"
yy57:
YYDEBUG(57, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1012,14 +1009,14 @@ yy64:
yy65:
YYDEBUG(65, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 563 "Zend/zend_ini_scanner.l"
#line 560 "Zend/zend_ini_scanner.l"
{ /* #Comment */
zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 1023 "Zend/zend_ini_scanner.c"
#line 1020 "Zend/zend_ini_scanner.c"
yy66:
YYDEBUG(66, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1159,7 +1156,7 @@ yyc_ST_DOUBLE_QUOTES:
yy76:
YYDEBUG(76, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 507 "Zend/zend_ini_scanner.l"
#line 504 "Zend/zend_ini_scanner.l"
{ /* Escape double quoted string contents */
if (YYCURSOR > YYLIMIT) {
return 0;
@@ -1195,7 +1192,7 @@ yy76:
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
return TC_QUOTED_STRING;
}
#line 1199 "Zend/zend_ini_scanner.c"
#line 1196 "Zend/zend_ini_scanner.c"
yy77:
YYDEBUG(77, *YYCURSOR);
++YYCURSOR;
@@ -1204,12 +1201,12 @@ yy77:
yy78:
YYDEBUG(78, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 502 "Zend/zend_ini_scanner.l"
#line 499 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string ends */
yy_pop_state(TSRMLS_C);
return '"';
}
#line 1213 "Zend/zend_ini_scanner.c"
#line 1210 "Zend/zend_ini_scanner.c"
yy79:
YYDEBUG(79, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1218,12 +1215,12 @@ yy79:
++YYCURSOR;
YYDEBUG(81, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 401 "Zend/zend_ini_scanner.l"
#line 398 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
#line 1227 "Zend/zend_ini_scanner.c"
#line 1224 "Zend/zend_ini_scanner.c"
yy82:
YYDEBUG(82, *YYCURSOR);
++YYCURSOR;
@@ -1323,11 +1320,11 @@ yy86:
yy87:
YYDEBUG(87, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 493 "Zend/zend_ini_scanner.l"
#line 490 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
#line 1331 "Zend/zend_ini_scanner.c"
#line 1328 "Zend/zend_ini_scanner.c"
yy88:
YYDEBUG(88, *YYCURSOR);
yyaccept = 0;
@@ -1344,23 +1341,23 @@ yy89:
yy90:
YYDEBUG(90, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 575 "Zend/zend_ini_scanner.l"
#line 572 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 1352 "Zend/zend_ini_scanner.c"
#line 1349 "Zend/zend_ini_scanner.c"
yy91:
YYDEBUG(91, *YYCURSOR);
++YYCURSOR;
yy92:
YYDEBUG(92, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 497 "Zend/zend_ini_scanner.l"
#line 494 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
#line 1364 "Zend/zend_ini_scanner.c"
#line 1361 "Zend/zend_ini_scanner.c"
yy93:
YYDEBUG(93, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1422,11 +1419,11 @@ yy97:
yy98:
YYDEBUG(98, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 471 "Zend/zend_ini_scanner.l"
#line 468 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
#line 1430 "Zend/zend_ini_scanner.c"
#line 1427 "Zend/zend_ini_scanner.c"
yy99:
YYDEBUG(99, *YYCURSOR);
yyaccept = 3;
@@ -1452,11 +1449,11 @@ yy99:
yy100:
YYDEBUG(100, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 467 "Zend/zend_ini_scanner.l"
#line 464 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
#line 1460 "Zend/zend_ini_scanner.c"
#line 1457 "Zend/zend_ini_scanner.c"
yy101:
YYDEBUG(101, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1467,12 +1464,12 @@ yy102:
yy103:
YYDEBUG(103, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 396 "Zend/zend_ini_scanner.l"
#line 393 "Zend/zend_ini_scanner.l"
{ /* End of section or an option offset */
BEGIN(INITIAL);
return ']';
}
#line 1476 "Zend/zend_ini_scanner.c"
#line 1473 "Zend/zend_ini_scanner.c"
yy104:
YYDEBUG(104, *YYCURSOR);
yyaccept = 0;
@@ -1762,7 +1759,7 @@ yy125:
++YYCURSOR;
YYDEBUG(128, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 368 "Zend/zend_ini_scanner.l"
#line 365 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -1771,18 +1768,18 @@ yy125:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 1775 "Zend/zend_ini_scanner.c"
#line 1772 "Zend/zend_ini_scanner.c"
yy129:
YYDEBUG(129, *YYCURSOR);
++YYCURSOR;
YYDEBUG(130, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 401 "Zend/zend_ini_scanner.l"
#line 398 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
#line 1786 "Zend/zend_ini_scanner.c"
#line 1783 "Zend/zend_ini_scanner.c"
yy131:
YYDEBUG(131, *YYCURSOR);
yyaccept = 0;
@@ -1887,12 +1884,12 @@ yyc_ST_RAW:
++YYCURSOR;
YYDEBUG(138, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 570 "Zend/zend_ini_scanner.l"
#line 567 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
#line 1896 "Zend/zend_ini_scanner.c"
#line 1893 "Zend/zend_ini_scanner.c"
yy139:
YYDEBUG(139, *YYCURSOR);
++YYCURSOR;
@@ -1901,7 +1898,7 @@ yy139:
yy140:
YYDEBUG(140, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 448 "Zend/zend_ini_scanner.l"
#line 445 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
/* Eat leading and trailing double quotes */
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
@@ -1910,7 +1907,7 @@ yy140:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 1914 "Zend/zend_ini_scanner.c"
#line 1911 "Zend/zend_ini_scanner.c"
yy141:
YYDEBUG(141, *YYCURSOR);
yyaccept = 0;
@@ -1932,13 +1929,13 @@ yy142:
yy143:
YYDEBUG(143, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 461 "Zend/zend_ini_scanner.l"
#line 458 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 1942 "Zend/zend_ini_scanner.c"
#line 1939 "Zend/zend_ini_scanner.c"
yy144:
YYDEBUG(144, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1966,13 +1963,13 @@ yy148:
yy149:
YYDEBUG(149, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 557 "Zend/zend_ini_scanner.l"
#line 554 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 1976 "Zend/zend_ini_scanner.c"
#line 1973 "Zend/zend_ini_scanner.c"
yy150:
YYDEBUG(150, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2071,21 +2068,21 @@ yyc_ST_SECTION_RAW:
yy160:
YYDEBUG(160, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 457 "Zend/zend_ini_scanner.l"
#line 454 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 2079 "Zend/zend_ini_scanner.c"
#line 2076 "Zend/zend_ini_scanner.c"
yy161:
YYDEBUG(161, *YYCURSOR);
++YYCURSOR;
YYDEBUG(162, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 575 "Zend/zend_ini_scanner.l"
#line 572 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 2089 "Zend/zend_ini_scanner.c"
#line 2086 "Zend/zend_ini_scanner.c"
yy163:
YYDEBUG(163, *YYCURSOR);
++YYCURSOR;
@@ -2094,13 +2091,13 @@ yy163:
yy164:
YYDEBUG(164, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 377 "Zend/zend_ini_scanner.l"
#line 374 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
#line 2104 "Zend/zend_ini_scanner.c"
#line 2101 "Zend/zend_ini_scanner.c"
yy165:
YYDEBUG(165, *YYCURSOR);
++YYCURSOR;
@@ -2222,11 +2219,11 @@ yy173:
yy174:
YYDEBUG(174, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 493 "Zend/zend_ini_scanner.l"
#line 490 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
#line 2230 "Zend/zend_ini_scanner.c"
#line 2227 "Zend/zend_ini_scanner.c"
yy175:
YYDEBUG(175, *YYCURSOR);
yyaccept = 0;
@@ -2245,23 +2242,23 @@ yy176:
yy177:
YYDEBUG(177, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 575 "Zend/zend_ini_scanner.l"
#line 572 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 2253 "Zend/zend_ini_scanner.c"
#line 2250 "Zend/zend_ini_scanner.c"
yy178:
YYDEBUG(178, *YYCURSOR);
++YYCURSOR;
yy179:
YYDEBUG(179, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 497 "Zend/zend_ini_scanner.l"
#line 494 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
#line 2265 "Zend/zend_ini_scanner.c"
#line 2262 "Zend/zend_ini_scanner.c"
yy180:
YYDEBUG(180, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2323,11 +2320,11 @@ yy184:
yy185:
YYDEBUG(185, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 471 "Zend/zend_ini_scanner.l"
#line 468 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
#line 2331 "Zend/zend_ini_scanner.c"
#line 2328 "Zend/zend_ini_scanner.c"
yy186:
YYDEBUG(186, *YYCURSOR);
yyaccept = 3;
@@ -2353,11 +2350,11 @@ yy186:
yy187:
YYDEBUG(187, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 467 "Zend/zend_ini_scanner.l"
#line 464 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
#line 2361 "Zend/zend_ini_scanner.c"
#line 2358 "Zend/zend_ini_scanner.c"
yy188:
YYDEBUG(188, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2370,13 +2367,13 @@ yy189:
yy190:
YYDEBUG(190, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 377 "Zend/zend_ini_scanner.l"
#line 374 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
#line 2380 "Zend/zend_ini_scanner.c"
#line 2377 "Zend/zend_ini_scanner.c"
yy191:
YYDEBUG(191, *YYCURSOR);
++YYCURSOR;
@@ -2688,7 +2685,7 @@ yy216:
++YYCURSOR;
YYDEBUG(219, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 368 "Zend/zend_ini_scanner.l"
#line 365 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -2697,18 +2694,18 @@ yy216:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 2701 "Zend/zend_ini_scanner.c"
#line 2698 "Zend/zend_ini_scanner.c"
yy220:
YYDEBUG(220, *YYCURSOR);
++YYCURSOR;
YYDEBUG(221, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 401 "Zend/zend_ini_scanner.l"
#line 398 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
#line 2712 "Zend/zend_ini_scanner.c"
#line 2709 "Zend/zend_ini_scanner.c"
yy222:
YYDEBUG(222, *YYCURSOR);
yyaccept = 0;
@@ -2888,12 +2885,12 @@ yy227:
yy228:
YYDEBUG(228, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 570 "Zend/zend_ini_scanner.l"
#line 567 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL */
BEGIN(INITIAL);
return END_OF_LINE;
}
#line 2897 "Zend/zend_ini_scanner.c"
#line 2894 "Zend/zend_ini_scanner.c"
yy229:
YYDEBUG(229, *YYCURSOR);
yyaccept = 0;
@@ -2902,11 +2899,11 @@ yy229:
yy230:
YYDEBUG(230, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 489 "Zend/zend_ini_scanner.l"
#line 486 "Zend/zend_ini_scanner.l"
{ /* Get everything else as option/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
#line 2910 "Zend/zend_ini_scanner.c"
#line 2907 "Zend/zend_ini_scanner.c"
yy231:
YYDEBUG(231, *YYCURSOR);
yyaccept = 1;
@@ -2915,24 +2912,24 @@ yy231:
yy232:
YYDEBUG(232, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 543 "Zend/zend_ini_scanner.l"
#line 540 "Zend/zend_ini_scanner.l"
{
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
}
#line 2923 "Zend/zend_ini_scanner.c"
#line 2920 "Zend/zend_ini_scanner.c"
yy233:
YYDEBUG(233, *YYCURSOR);
++YYCURSOR;
yy234:
YYDEBUG(234, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 461 "Zend/zend_ini_scanner.l"
#line 458 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 2936 "Zend/zend_ini_scanner.c"
#line 2933 "Zend/zend_ini_scanner.c"
yy235:
YYDEBUG(235, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2946,23 +2943,23 @@ yy236:
yy237:
YYDEBUG(237, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 479 "Zend/zend_ini_scanner.l"
#line 476 "Zend/zend_ini_scanner.l"
{ /* Boolean operators */
return yytext[0];
}
#line 2954 "Zend/zend_ini_scanner.c"
#line 2951 "Zend/zend_ini_scanner.c"
yy238:
YYDEBUG(238, *YYCURSOR);
++YYCURSOR;
yy239:
YYDEBUG(239, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 497 "Zend/zend_ini_scanner.l"
#line 494 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
#line 2966 "Zend/zend_ini_scanner.c"
#line 2963 "Zend/zend_ini_scanner.c"
yy240:
YYDEBUG(240, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3038,11 +3035,11 @@ yy244:
yy245:
YYDEBUG(245, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 471 "Zend/zend_ini_scanner.l"
#line 468 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
#line 3046 "Zend/zend_ini_scanner.c"
#line 3043 "Zend/zend_ini_scanner.c"
yy246:
YYDEBUG(246, *YYCURSOR);
yyaccept = 2;
@@ -3053,13 +3050,13 @@ yy247:
++YYCURSOR;
YYDEBUG(248, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 483 "Zend/zend_ini_scanner.l"
#line 480 "Zend/zend_ini_scanner.l"
{ /* Make = used in option value to trigger error */
yyless(0);
BEGIN(INITIAL);
return END_OF_LINE;
}
#line 3063 "Zend/zend_ini_scanner.c"
#line 3060 "Zend/zend_ini_scanner.c"
yy249:
YYDEBUG(249, *YYCURSOR);
yyaccept = 4;
@@ -3095,11 +3092,11 @@ yy249:
yy250:
YYDEBUG(250, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 467 "Zend/zend_ini_scanner.l"
#line 464 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
#line 3103 "Zend/zend_ini_scanner.c"
#line 3100 "Zend/zend_ini_scanner.c"
yy251:
YYDEBUG(251, *YYCURSOR);
yyaccept = 4;
@@ -3591,11 +3588,11 @@ yy266:
yy267:
YYDEBUG(267, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 421 "Zend/zend_ini_scanner.l"
#line 418 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
#line 3599 "Zend/zend_ini_scanner.c"
#line 3596 "Zend/zend_ini_scanner.c"
yy268:
YYDEBUG(268, *YYCURSOR);
++YYCURSOR;
@@ -3795,11 +3792,11 @@ yy273:
yy274:
YYDEBUG(274, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 425 "Zend/zend_ini_scanner.l"
#line 422 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
#line 3803 "Zend/zend_ini_scanner.c"
#line 3800 "Zend/zend_ini_scanner.c"
yy275:
YYDEBUG(275, *YYCURSOR);
++YYCURSOR;
@@ -4175,13 +4172,13 @@ yy286:
yy287:
YYDEBUG(287, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 557 "Zend/zend_ini_scanner.l"
#line 554 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 4185 "Zend/zend_ini_scanner.c"
#line 4182 "Zend/zend_ini_scanner.c"
yy288:
YYDEBUG(288, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4393,7 +4390,7 @@ yy297:
++YYCURSOR;
YYDEBUG(300, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 368 "Zend/zend_ini_scanner.l"
#line 365 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@@ -4402,18 +4399,18 @@ yy297:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 4406 "Zend/zend_ini_scanner.c"
#line 4403 "Zend/zend_ini_scanner.c"
yy301:
YYDEBUG(301, *YYCURSOR);
++YYCURSOR;
YYDEBUG(302, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 401 "Zend/zend_ini_scanner.l"
#line 398 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
#line 4417 "Zend/zend_ini_scanner.c"
#line 4414 "Zend/zend_ini_scanner.c"
yy303:
YYDEBUG(303, *YYCURSOR);
++YYCURSOR;
@@ -4542,7 +4539,7 @@ yyc_ST_VARNAME:
yy313:
YYDEBUG(313, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 406 "Zend/zend_ini_scanner.l"
#line 403 "Zend/zend_ini_scanner.l"
{ /* Variable name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
@@ -4552,28 +4549,28 @@ yy313:
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
}
#line 4556 "Zend/zend_ini_scanner.c"
#line 4553 "Zend/zend_ini_scanner.c"
yy314:
YYDEBUG(314, *YYCURSOR);
++YYCURSOR;
YYDEBUG(315, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 575 "Zend/zend_ini_scanner.l"
#line 572 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 4566 "Zend/zend_ini_scanner.c"
#line 4563 "Zend/zend_ini_scanner.c"
yy316:
YYDEBUG(316, *YYCURSOR);
++YYCURSOR;
YYDEBUG(317, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 416 "Zend/zend_ini_scanner.l"
#line 413 "Zend/zend_ini_scanner.l"
{ /* Variable end */
yy_pop_state(TSRMLS_C);
return '}';
}
#line 4577 "Zend/zend_ini_scanner.c"
#line 4574 "Zend/zend_ini_scanner.c"
yy318:
YYDEBUG(318, *YYCURSOR);
++YYCURSOR;
@@ -4587,6 +4584,6 @@ yy319:
goto yy313;
}
}
#line 579 "Zend/zend_ini_scanner.l"
#line 576 "Zend/zend_ini_scanner.l"
}
+3 -6
View File
@@ -228,12 +228,9 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh, int scanner_mode TSRML
char *buf;
size_t size;
if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE) {
return FAILURE;
}
if (init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE) {
zend_file_handle_dtor(fh TSRMLS_CC);
if (zend_stream_fixup(fh, &buf, &size TSRMLS_CC) == FAILURE ||
init_ini_scanner(scanner_mode, fh TSRMLS_CC) == FAILURE
) {
return FAILURE;
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Sat Feb 25 22:07:14 2012 */
/* Generated by re2c 0.13.5 on Fri Aug 26 18:01:17 2011 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
+1 -1
View File
@@ -127,7 +127,7 @@ ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRM
}
/* }}} */
/* {{{ zend_user_it_invalidate_current */
/* {{{ zend_user_it_dtor */
ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC)
{
zend_user_iterator *iter = (zend_user_iterator*)_iter;
File diff suppressed because it is too large. Load diff
+1 -5
View File
@@ -1361,11 +1361,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
if (len < SIZEOF_LONG * 2 || (len == SIZEOF_LONG * 2 && *hex <= '7')) {
if (len == 0) {
zendlval->value.lval = 0;
} else {
zendlval->value.lval = strtol(hex, NULL, 16);
}
zendlval->value.lval = strtol(hex, NULL, 16);
zendlval->type = IS_LONG;
return T_LNUMBER;
} else {
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Wed Feb 15 17:38:31 2012 */
/* Generated by re2c 0.13.5 on Mon Jan 3 05:56:03 2011 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
+7 -8
View File
@@ -3224,15 +3224,14 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
int return_value_used;
zend_free_op free_op1;
zval *inc_filename = GET_OP1_ZVAL_PTR(BP_VAR_R);
zval *tmp_inc_filename = NULL;
zval tmp_inc_filename;
zend_bool failure_retval=0;
if (inc_filename->type!=IS_STRING) {
MAKE_STD_ZVAL(tmp_inc_filename);
*tmp_inc_filename = *inc_filename;
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
convert_to_string(&tmp_inc_filename);
inc_filename = &tmp_inc_filename;
}
return_value_used = RETURN_VALUE_USED(opline);
@@ -3298,8 +3297,8 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
EMPTY_SWITCH_DEFAULT_CASE()
}
}
if (tmp_inc_filename) {
zval_ptr_dtor(&tmp_inc_filename);
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
FREE_OP1();
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
+28 -32
View File
@@ -1902,15 +1902,14 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
int return_value_used;
zval *inc_filename = &opline->op1.u.constant;
zval *tmp_inc_filename = NULL;
zval tmp_inc_filename;
zend_bool failure_retval=0;
if (inc_filename->type!=IS_STRING) {
MAKE_STD_ZVAL(tmp_inc_filename);
*tmp_inc_filename = *inc_filename;
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
convert_to_string(&tmp_inc_filename);
inc_filename = &tmp_inc_filename;
}
return_value_used = RETURN_VALUE_USED(opline);
@@ -1976,8 +1975,8 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
EMPTY_SWITCH_DEFAULT_CASE()
}
}
if (tmp_inc_filename) {
zval_ptr_dtor(&tmp_inc_filename);
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
@@ -5191,15 +5190,14 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
int return_value_used;
zend_free_op free_op1;
zval *inc_filename = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zval *tmp_inc_filename = NULL;
zval tmp_inc_filename;
zend_bool failure_retval=0;
if (inc_filename->type!=IS_STRING) {
MAKE_STD_ZVAL(tmp_inc_filename);
*tmp_inc_filename = *inc_filename;
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
convert_to_string(&tmp_inc_filename);
inc_filename = &tmp_inc_filename;
}
return_value_used = RETURN_VALUE_USED(opline);
@@ -5265,8 +5263,8 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
EMPTY_SWITCH_DEFAULT_CASE()
}
}
if (tmp_inc_filename) {
zval_ptr_dtor(&tmp_inc_filename);
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
zval_dtor(free_op1.var);
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
@@ -8575,15 +8573,14 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
int return_value_used;
zend_free_op free_op1;
zval *inc_filename = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
zval *tmp_inc_filename = NULL;
zval tmp_inc_filename;
zend_bool failure_retval=0;
if (inc_filename->type!=IS_STRING) {
MAKE_STD_ZVAL(tmp_inc_filename);
*tmp_inc_filename = *inc_filename;
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
convert_to_string(&tmp_inc_filename);
inc_filename = &tmp_inc_filename;
}
return_value_used = RETURN_VALUE_USED(opline);
@@ -8649,8 +8646,8 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
EMPTY_SWITCH_DEFAULT_CASE()
}
}
if (tmp_inc_filename) {
zval_ptr_dtor(&tmp_inc_filename);
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
@@ -22468,15 +22465,14 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
int return_value_used;
zval *inc_filename = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
zval *tmp_inc_filename = NULL;
zval tmp_inc_filename;
zend_bool failure_retval=0;
if (inc_filename->type!=IS_STRING) {
MAKE_STD_ZVAL(tmp_inc_filename);
*tmp_inc_filename = *inc_filename;
zval_copy_ctor(tmp_inc_filename);
convert_to_string(tmp_inc_filename);
inc_filename = tmp_inc_filename;
tmp_inc_filename = *inc_filename;
zval_copy_ctor(&tmp_inc_filename);
convert_to_string(&tmp_inc_filename);
inc_filename = &tmp_inc_filename;
}
return_value_used = RETURN_VALUE_USED(opline);
@@ -22542,8 +22538,8 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
EMPTY_SWITCH_DEFAULT_CASE()
}
}
if (tmp_inc_filename) {
zval_ptr_dtor(&tmp_inc_filename);
if (inc_filename==&tmp_inc_filename) {
zval_dtor(&tmp_inc_filename);
}
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
-6
View File
@@ -2438,12 +2438,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
dnl
dnl Check libc first if no path is provided in --with-iconv
dnl
if test "$PHP_ICONV" = "yes"; then
dnl Reset LIBS temporarily as it may have already been included
dnl -liconv in.
LIBS_save="$LIBS"
LIBS=
AC_CHECK_FUNC(iconv, [
found_iconv=yes
],[
@@ -2453,7 +2448,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [
found_iconv=yes
])
])
LIBS="$LIBS_save"
fi
dnl
+3 -18
View File
@@ -31,7 +31,7 @@ dnl Basic autoconf + automake initialization, generation of config.nice.
dnl -------------------------------------------------------------------------
AC_PREREQ(2.13)
AC_INIT(README.GIT-RULES)
AC_INIT(README.SVN-RULES)
PHP_CONFIG_NICE(config.nice)
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=14
PHP_RELEASE_VERSION=9
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
@@ -155,7 +155,7 @@ dnl Check if bison generated files exist when bison does not..
case $php_cv_bison_version in
""|invalid[)]
if ! test -f "$abs_srcdir/Zend/zend_language_parser.h" || ! test -f "$abs_srcdir/Zend/zend_language_parser.c" ; then
AC_MSG_ERROR([bison is required to build PHP/Zend when building a GIT checkout!])
AC_MSG_ERROR([bison is required to build PHP/Zend when building a SVN checkout!])
fi
;;
esac
@@ -1550,21 +1550,6 @@ cat <<X
X
fi
if test "$PHP_SAPI" = "apache2handler" || test "$PHP_SAPI" = "apache2filter"; then
if test "$APACHE_VERSION" -ge 2004001; then
if test -z "$APACHE_THREADED_MPM"; then
cat <<X
+--------------------------------------------------------------------+
| *** WARNING *** |
| |
| You have built PHP for Apache's current non-threaded MPM. |
| If you change Apache to use a threaded MPM you must reconfigure |
| PHP with --enable-maintainer-zts |
X
fi
fi
fi
# Warn about linking Apache with libpthread if oci8 extension is enabled on linux.
if test "$PHP_OCI8" != "no"; then
if test "$PHP_SAPI" = "apache"; then
-25
View File
@@ -2,34 +2,9 @@
unixtojd()
--SKIPIF--
<?php include 'skipif.inc'; ?>
--ENV--
TZ=UTC
--FILE--
<?php
// this line has no impact on test output on Windows
putenv('TZ=UTC');
// getenv('TZ') returns 'UTC' here
// putenv (basic_functions.c) does call tzset() when the env var being put is 'TZ'
// -adding a call direct to GetEnvironmentVariableA just before tzset() is called to check the value of 'TZ' returns 'UTC'
// putting a call to date_default_timezone_set() here doesn't help
//
// on Windows, the only thing that gets this test to pass is to put TZ=UTC in --ENV-- section
// -since putenv() is written to call tzset() when env var is TZ, I assume that putenv("TZ=UTC") is intended to work
// and should work on all platforms(including Windows).
// easter_date.phpt passes
// -doesn't use --ENV-- section
// -uses --INI-- section with date.timezone=UTC
// -uses putenv('TZ=UTC')
// date.timezone=UTC
// -if ommitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
// -easter_date() calls mktime() and localtime()
// -whereas unixtojd(1000000000) calls localtime(1000000000)
// -if ommitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
//
// unixtojd() calls php_localtime_r() which for Pacific timezone systems, returns a time -8 hours
// -this incorrect localtime is passed to the julian date conversion (GregorianToSDN) function which works (probably correctly)
// but returns -1 day from expected because its input is -1 from expected
echo unixtojd(40000). "\n";
echo unixtojd(1000000000). "\n";
echo unixtojd(1152459009). "\n";
+3 -3
View File
@@ -42,7 +42,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
}
}
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
int codepage TSRMLS_DC)
{
php_com_dotnet_object *obj;
@@ -65,7 +65,7 @@ PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
z->value.obj.handlers = &php_com_object_handlers;
}
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
int codepage TSRMLS_DC)
{
php_com_dotnet_object *obj;
@@ -92,7 +92,7 @@ PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
/* this is a convenience function for fetching a particular
* element from a (possibly multi-dimensional) safe array */
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
{
UINT dims;
LONG lbound, ubound;
+2 -2
View File
@@ -30,7 +30,7 @@
#include "php_com_dotnet_internal.h"
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
{
OLECHAR *olestring = NULL;
DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
@@ -65,7 +65,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint strin
return olestring;
}
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
{
char *string;
uint length = 0;
+1 -1
View File
@@ -271,7 +271,7 @@ static void istream_destructor(php_istream *stm)
}
/* }}} */
PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
{
php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
+3 -3
View File
@@ -35,7 +35,7 @@
* b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
* c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
*/
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
{
ITypeLib *TL = NULL;
char *strtok_buf, *major, *minor;
@@ -153,7 +153,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
}
/* Given a type-library, merge it into the current engine state */
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
{
int i, j, interfaces;
TYPEKIND pTKind;
@@ -224,7 +224,7 @@ void php_com_typelibrary_dtor(void *pDest)
ITypeLib_Release(*Lib);
}
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
int codepage, int *cached TSRMLS_DC)
{
ITypeLib **TLp;
+3 -3
View File
@@ -98,7 +98,7 @@ bogus:
}
}
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
{
OLECHAR *olestring;
php_com_dotnet_object *obj;
@@ -166,7 +166,7 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
}
}
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
{
OLECHAR *olestring = NULL;
int ret = SUCCESS;
@@ -258,7 +258,7 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
}
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
PHPAPI int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
{
int ret = SUCCESS;
+2 -2
View File
@@ -586,7 +586,7 @@ static void disp_destructor(php_dispatchex *disp)
CoTaskMemFree(disp);
}
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
HashTable *id_to_name TSRMLS_DC)
{
php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
@@ -625,7 +625,7 @@ PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *si
return (IDispatch*)disp;
}
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
{
php_dispatchex *disp = NULL;
-8
View File
@@ -28,14 +28,6 @@ extern zend_module_entry com_dotnet_module_entry;
#include "TSRM.h"
#endif
#ifdef PHP_WIN32
# define PHP_COM_DOTNET_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
# define PHP_COM_DOTNET_API __attribute__ ((visibility("default")))
#else
# define PHP_COM_DOTNET_API
#endif
PHP_MINIT_FUNCTION(com_dotnet);
PHP_MSHUTDOWN_FUNCTION(com_dotnet);
PHP_RINIT_FUNCTION(com_dotnet);
+14 -14
View File
@@ -87,9 +87,9 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
/* com_olechar.c */
PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring,
uint *string_len, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
PHPAPI OLECHAR *php_com_string_to_olestring(char *string,
uint string_len, int codepage TSRMLS_DC);
@@ -115,8 +115,8 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
/* com_wrapper.c */
int php_com_wrapper_minit(INIT_FUNC_ARGS);
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
/* com_persist.c */
int php_com_persist_minit(INIT_FUNC_ARGS);
@@ -150,10 +150,10 @@ PHP_FUNCTION(variant_get_type);
PHP_FUNCTION(variant_set_type);
PHP_FUNCTION(variant_cast);
PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
PHPAPI void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
PHPAPI int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
/* com_dotnet.c */
PHP_FUNCTION(com_dotnet_create_instance);
@@ -162,17 +162,17 @@ void php_com_dotnet_mshutdown(TSRMLS_D);
/* com_misc.c */
void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
int codepage TSRMLS_DC);
PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
/* com_typeinfo.c */
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
int codepage, int *cached TSRMLS_DC);
PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode,
int codepage TSRMLS_DC);
void php_com_typelibrary_dtor(void *pDest);
ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);
-14
View File
@@ -3,23 +3,9 @@ Bug #49192 (PHP crashes when GC invoked on COM object)
--SKIPIF--
<?php
if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
--XFAIL--
1
--FILE--
<?php
// this test fails to load ADO
//
// a change in windows longhorn x64(affecting vista, 7, 8, 2008, 2008r2) broke ADO.
//
// there is a fix available, but user has to install it.
// given that ADO was deprecated a long time ago in favor of newer APIs,
// I don't think its worth the trouble of making the user install the fix to
// get an accurate test run. its better to just not run the test or expect it to fail.
//
// see: http://support.microsoft.com/kb/2517589
// see: http://www.infoq.com/news/2011/10/ADO-Win7
$dbConnection = new Com('ADODB.Connection');
var_dump(gc_collect_cycles());
?>
+1 -1
View File
@@ -2167,7 +2167,7 @@ string_copy:
convert_to_string_ex(zvalue);
if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
RETVAL_FALSE;
return 1;
}
-20
View File
@@ -1,20 +0,0 @@
--TEST--
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--INI--
open_basedir="/tmp"
--FILE--
<?php
$ch = curl_init();
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/foo"));
var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "/xxx/bar"));
curl_close($ch);
?>
--EXPECTF--
bool(false)
bool(true)
Warning: curl_setopt(): open_basedir restriction in effect. File(/xxx/bar) is not within the allowed path(s): (/tmp) in %sbug61948.php on line %d
bool(false)
+1 -1
View File
@@ -26,5 +26,5 @@ curl_close($ch);
?>
--EXPECTF--
%unicode|string%(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:)%r %s"
%unicode|string%(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:)%r %s"
int(5)
+725 -727
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -75,7 +75,7 @@ result = Monday 1983-04-18 01:00:00 CEST
wanted = Monday 00:00:00
Asia/Yerevan
ts = Monday 2037-10-19 17:17:17 AMT
ts = Monday 2037-10-19 17:17:17 AMST
result = Monday 2037-10-26 00:00:00 AMT
wanted = Monday 00:00:00
+3 -5
View File
@@ -11,7 +11,6 @@ date.timezone=UTC
$d = new DateTime('@100000000000');
var_dump($d->format('Y-m-d H:i:s U'));
var_dump($d->getTimestamp());
var_dump($d->format('U'));
$d->setTimestamp(100000000000);
var_dump($d->format('Y-m-d H:i:s U'));
@@ -22,8 +21,7 @@ var_dump($i->format('%s'));
?>
--EXPECT--
string(32) "5138-11-16 09:46:40 100000000000"
bool(false)
int(100000000000)
string(32) "5138-11-16 09:46:40 100000000000"
int(100000000000)
string(12) "100000000000"
string(30) "2008-07-11 04:56:32 1215752192"
int(1215752192)
string(10) "1215752192"
@@ -1,24 +0,0 @@
--TEST--
date_default_timezone_get() function [1]
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) != 'WIN') die("skip skip on non windows");
?>
--INI--
date.timezone=
--FILE--
<?php
putenv('TZ=');
echo date_default_timezone_get(), "\n";
echo date('e'), "\n";
/* The behaviour on windows is to select an arbitrary timezone name from the current system settings.
This gives no chance to hardcode the timezone name, for instance for UTC+1 it could choose
from the multiple names like Europe/Berlin or Europe/Paris . For this reason the test is
parametrized so there is no hardcoded timezone data.*/
?>
--EXPECTF--
Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected '%s' for '%s' instead in %sdate_default_timezone_get-1-win32.php on line 3
%s
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected '%s' for '%s' instead in %sdate_default_timezone_get-1-win32.php on line 4
%s
@@ -1,9 +1,5 @@
--TEST--
date_default_timezone_get() function [1]
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == 'WIN') die("skip on windows");
?>
--INI--
date.timezone=
--FILE--
@@ -1,20 +0,0 @@
--TEST--
date_default_timezone_get() function [2]
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) != 'WIN') die("skip on non windows");
?>
--INI--
date.timezone=
--FILE--
<?php
putenv('TZ=');
echo date_default_timezone_get(), "\n";
/* The behaviour on windows is to select an arbitrary timezone name from the current system settings.
This gives no chance to hardcode the timezone name, for instance for UTC+1 it could choose
from the multiple names like Europe/Berlin or Europe/Paris . For this reason the test is
parametrized so there is no hardcoded timezone data.*/
?>
--EXPECTF--
Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected '%s' for '%s' instead in %sdate_default_timezone_get-2-win32.php on line 3
%s
@@ -1,9 +1,5 @@
--TEST--
date_default_timezone_get() function [2]
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == 'WIN') die("skip on windows");
?>
--INI--
date.timezone=
--FILE--
+1 -1
View File
@@ -189,6 +189,6 @@ int cdb_find(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
/* {{{ cdb_version */
char *cdb_version()
{
return "0.75, $Id$";
return "0.75, $Revision$";
}
/* }}} */
+1 -1
View File
@@ -240,5 +240,5 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
/* {{{ cdb_make_version */
char *cdb_make_version()
{
return "0.75, $Id$";
return "0.75, $Revision$";
}
+1 -1
View File
@@ -307,7 +307,7 @@ datum flatfile_nextkey(flatfile *dba TSRMLS_DC) {
/* {{{ flatfile_version */
char *flatfile_version()
{
return "1.0, $Id$";
return "1.0, $Revision$";
}
/* }}} */
+1 -1
View File
@@ -43,7 +43,7 @@
/* {{{ inifile_version */
char *inifile_version()
{
return "1.0, $Id$";
return "1.0, $Revision$";
}
/* }}} */
-82
View File
@@ -466,87 +466,6 @@ static int dom_property_exists(zval *object, zval *member, int check_empty TSRML
}
/* }}} */
static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
{
dom_object *obj = zend_object_store_get_object(object TSRMLS_CC);
HashTable *debug_info,
*prop_handlers = obj->prop_handler,
*std_props;
HashPosition pos;
dom_prop_handler *entry;
zval *object_value,
*null_value;
*is_temp = 1;
ALLOC_HASHTABLE(debug_info);
ZEND_INIT_SYMTABLE_EX(debug_info, 32, 0);
std_props = zend_std_get_properties(object TSRMLS_CC);
zend_hash_copy(debug_info, std_props, (copy_ctor_func_t)zval_add_ref,
NULL, sizeof(zval*));
if (!prop_handlers) {
return debug_info;
}
ALLOC_INIT_ZVAL(object_value);
ZVAL_STRING(object_value, "(object value omitted)", 1);
ALLOC_INIT_ZVAL(null_value);
ZVAL_NULL(null_value);
for (zend_hash_internal_pointer_reset_ex(prop_handlers, &pos);
zend_hash_get_current_data_ex(prop_handlers, (void **)&entry, &pos)
== SUCCESS;
zend_hash_move_forward_ex(prop_handlers, &pos)) {
zval *value;
char *string_key = NULL;
uint string_length = 0;
ulong num_key;
if (entry->read_func(obj, &value TSRMLS_CC) == FAILURE) {
continue;
}
if (zend_hash_get_current_key_ex(prop_handlers, &string_key,
&string_length, &num_key, 0, &pos) != HASH_KEY_IS_STRING) {
continue;
}
if (value == EG(uninitialized_zval_ptr)) {
value = null_value;
} else if (Z_TYPE_P(value) == IS_OBJECT) {
/* these are zvalues create on demand, with refcount and is_ref
* status left in an uninitalized stated */
zval_dtor(value);
efree(value);
value = object_value;
} else {
/* see comment above */
Z_SET_REFCOUNT_P(value, 0);
Z_UNSET_ISREF_P(value);
}
zval_add_ref(&value);
zend_hash_add(debug_info, string_key, string_length,
&value, sizeof(zval *), NULL);
}
zval_ptr_dtor(&null_value);
zval_ptr_dtor(&object_value);
return debug_info;
}
/* }}} */
static HashTable* dom_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
{
return dom_get_debug_info_helper(object, is_temp TSRMLS_CC);
}
/* }}} */
void *php_dom_export_node(zval *object TSRMLS_DC) /* {{{ */
{
php_libxml_node_object *intern;
@@ -667,7 +586,6 @@ PHP_MINIT_FUNCTION(dom)
dom_object_handlers.get_property_ptr_ptr = dom_get_property_ptr_ptr;
dom_object_handlers.clone_obj = dom_objects_store_clone_obj;
dom_object_handlers.has_property = dom_property_exists;
dom_object_handlers.get_debug_info = dom_get_debug_info;
zend_hash_init(&classes, 0, NULL, NULL, 1);
@@ -8,7 +8,8 @@ Eric Lee Stewart <ericleestewart@gmail.com>
--FILE--
<?php
$fragment = new DOMDocumentFragment();
var_dump(get_class($fragment));
var_dump($fragment);
?>
--EXPECT--
string(19) "DOMDocumentFragment"
--EXPECTF--
object(DOMDocumentFragment)#%d (%d) {
}
@@ -12,7 +12,7 @@ require_once('skipif.inc');
require_once('dom_test.inc');
chdir(__DIR__);
chdir(__DIR__ . "/../examples");
$XMLStringGood = file_get_contents('note.xml');
$dom = new DOMDocument;
@@ -19,7 +19,7 @@ if(!$dom) {
$element = $dom->documentElement;
echo "Verify that we have a DOMElement object:\n";
echo get_class($element), "\n";
var_dump($element);
echo "\nElement should have attributes:\n";
var_dump($element->hasAttributes());
@@ -28,22 +28,24 @@ $nodelist=$dom->getElementsByTagName('tbody') ;
$element = $nodelist->item(0);
echo "\nVerify that we have a DOMElement object:\n";
echo get_class($element), "\n";
var_dump($element);
echo "\nElement should have no attributes:\n";
var_dump($element->hasAttributes());
var_dump($element->hasAttributes())
?>
--EXPECTF--
Verify that we have a DOMElement object:
DOMElement
object(DOMElement)#%d (0) {
}
Element should have attributes:
bool(true)
Verify that we have a DOMElement object:
DOMElement
object(DOMElement)#%d (0) {
}
Element should have no attributes:
bool(false)
+12 -7
View File
@@ -29,7 +29,7 @@ EOXML;
function dumpcourse($current) {
$title = ($current->nodeType != XML_TEXT_NODE && $current->hasAttribute('title')) ? $current->getAttribute('title'):"no title";
echo "Course: $title:";echo(get_class($current)), "\n";
echo "Course: $title:";var_dump($current);
echo "~";var_dump($current->textContent);
}
@@ -75,7 +75,8 @@ for ($index = 0; $index < $children->length; $index++) {
--EXPECTF--
Start cloneNode test
node 0
Course: new title3:DOMElement
Course: new title3:object(DOMElement)#6 (0) {
}
~string(24) "
c1n1
@@ -83,7 +84,8 @@ Course: new title3:DOMElement
"
node 1
Course: two:DOMElement
Course: two:object(DOMElement)#3 (0) {
}
~string(24) "
c2n1
@@ -91,10 +93,12 @@ Course: two:DOMElement
"
node 2
Course: new title default:DOMElement
Course: new title default:object(DOMElement)#4 (0) {
}
~string(0) ""
node 3
Course: new title true:DOMElement
Course: new title true:object(DOMElement)#7 (0) {
}
~string(24) "
c1n1
@@ -102,5 +106,6 @@ Course: new title true:DOMElement
"
node 4
Course: new title false:DOMElement
~string(0) ""
Course: new title false:object(DOMElement)#8 (0) {
}
~string(0) ""
+16 -9
View File
@@ -29,7 +29,7 @@ EOXML;
function dumpcourse($current) {
$title = ($current->nodeType != XML_TEXT_NODE && $current->hasAttribute('title')) ? $current->getAttribute('title'):"no title";
echo "Course: $title:";echo get_class($current), "\n";
echo "Course: $title:";var_dump($current);
echo "~";var_dump($current->textContent);
}
@@ -60,11 +60,13 @@ for ($index = 0; $index < $children->length; $index++) {
--EXPECTF--
orignal has 5 nodes
node 4
Course: no title:DOMText
Course: no title:object(DOMText)#4 (0) {
}
~string(1) "
"
node 3
Course: two:DOMElement
Course: two:object(DOMElement)#5 (0) {
}
~string(24) "
c2n1
@@ -72,11 +74,13 @@ Course: two:DOMElement
"
node 2
Course: no title:DOMText
Course: no title:object(DOMText)#6 (0) {
}
~string(2) "
"
node 1
Course: one:DOMElement
Course: one:object(DOMElement)#4 (0) {
}
~string(24) "
c1n1
@@ -84,12 +88,14 @@ Course: one:DOMElement
"
node 0
Course: no title:DOMText
Course: no title:object(DOMText)#5 (0) {
}
~string(2) "
"
after text removed it now has 2 nodes
node 0
Course: one:DOMElement
Course: one:object(DOMElement)#3 (0) {
}
~string(24) "
c1n1
@@ -97,10 +103,11 @@ Course: one:DOMElement
"
node 1
Course: two:DOMElement
Course: two:object(DOMElement)#4 (0) {
}
~string(24) "
c2n1
c2n2
"
"
+4 -3
View File
@@ -7,7 +7,7 @@ Bug #42082 (NodeList length zero should be empty)
$doc = new DOMDocument();
$xpath = new DOMXPath($doc);
$nodes = $xpath->query('*');
echo get_class($nodes), "\n";
var_dump($nodes);
var_dump($nodes->length);
$length = $nodes->length;
var_dump(empty($nodes->length), empty($length));
@@ -18,7 +18,8 @@ var_dump(empty($doc->nodeType), empty($doc->firstChild->nodeType))
?>
===DONE===
--EXPECTF--
DOMNodeList
object(DOMNodeList)#%d (0) {
}
int(0)
bool(true)
bool(true)
@@ -28,4 +29,4 @@ bool(true)
bool(false)
bool(false)
===DONE===
+3 -3
View File
@@ -6,9 +6,9 @@ Bug #52656 (DOMCdataSection does not work with splitText).
<?php
$CData = new DOMCdataSection('splithere!');
$CDataSplit = $CData->splitText(5);
echo get_class($CDataSplit), "\n";
var_dump($CDataSplit->data);
var_dump($CDataSplit, $CDataSplit->data);
?>
--EXPECT--
DOMText
object(DOMText)#2 (0) {
}
string(5) "here!"
+3 -2
View File
@@ -17,13 +17,14 @@ $doc = new DOMDocument();
$doc->loadXML($xml, LIBXML_NOENT);
$n = $doc->doctype;
$doc->removeChild($n);
echo get_class($n), "\n";
var_dump($n);
print $doc->saveXML();
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
DOMDocumentType
object(DOMDocumentType)#%d (0) {
}
<?xml version="1.0" encoding="utf-8"?>
<set><foo>footext</foo><bar>bartext</bar></set>
===DONE===
+3 -6
View File
@@ -12,11 +12,7 @@ print "--- Catch exception with try/catch\n";
try {
$rootNode->appendChild($rootNode);
} catch (domexception $e) {
ob_start();
var_dump($e);
$contents = ob_get_contents();
ob_end_clean();
echo preg_replace('/object\(DOMElement\).+\{.*?\}/s', 'DOMElement', $contents);
}
print "--- Don't catch exception with try/catch\n";
$rootNode->appendChild($rootNode);
@@ -51,7 +47,8 @@ object(DOMException)#%d (%d) {
["args"]=>
array(1) {
[0]=>
DOMElement
object(DOMElement)#%d (0) {
}
}
}
}
@@ -64,6 +61,6 @@ object(DOMException)#%d (%d) {
Fatal error: Uncaught exception 'DOMException' with message 'Hierarchy Request Error' in %sdom003.php:%d
Stack trace:
#0 %sdom003.php(%d): DOMNode->appendChild(Object(DOMElement))
#0 %sdom003.php(13): DOMNode->appendChild(Object(DOMElement))
#1 {main}
thrown in %sdom003.php on line %d
+7 -19
View File
@@ -63,24 +63,12 @@ echo "\n";
$ents = $dtd->entities;
$length = $ents->length;
echo "Length: ".$length."\n";
$xkeys = array();
foreach ($ents AS $key=>$node) {
$xkeys[] = "Key: $key Name: ".$node->nodeName."\n";
}
sort($xkeys); // fix inconsistent output ordering (bug #61810)
foreach ($xkeys as $key => $node) {
echo $node;
echo "Key: $key Name: ".$node->nodeName."\n";
}
echo "\n";
$xkeys = array();
for($x=0; $x < $length; $x++) {
$xkeys[] = "Index: ".$ents->item($x)->nodeName."\n";
}
sort($xkeys); // fix inconsistent output ordering (bug #61810)
foreach ($xkeys as $key => $node) {
echo $node;
echo "Index $x: ".$ents->item($x)->nodeName."\n";
}
echo "\n";
@@ -99,13 +87,13 @@ Index 0: GIF (image/gif) (-)
NULL
Length: 3
Key: myimage Name: myimage
Key: rdf Name: rdf
Key: test Name: test
Key: rdf Name: rdf
Key: myimage Name: myimage
Index: myimage
Index: rdf
Index: test
Index 0: test
Index 1: rdf
Index 2: myimage
NULL
NULL
+7 -4
View File
@@ -23,21 +23,24 @@ $children = $root->childNodes;
for ($index = 0; $index < $children->length; $index++) {
echo "--- child $index ---\n";
$current = $children->item($index);
echo get_class($current), "\n";
var_dump($current);
var_dump($current->textContent);
}
--EXPECTF--
bool(true)
--- child 0 ---
DOMText
object(DOMText)#%d (0) {
}
string(2) "
"
--- child 1 ---
DOMComment
object(DOMComment)#%d (0) {
}
string(14) " Hello World! "
--- child 2 ---
DOMText
object(DOMText)#%d (0) {
}
string(1) "
"
+3 -2
View File
@@ -20,13 +20,14 @@ $children = $root->childNodes;
for ($index = 0; $index < $children->length; $index++) {
echo "--- child $index ---\n";
$current = $children->item($index);
echo get_class($current), "\n";
var_dump($current);
var_dump($current->textContent);
}
--EXPECTF--
bool(true)
--- child 0 ---
DOMComment
object(DOMComment)#%d (0) {
}
string(14) " Hello World! "
+4 -9
View File
@@ -2,8 +2,6 @@
Test: setAttributeNode()
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--INI--
error_reporting = E_ALL & ~E_WARNING
--FILE--
<?php
@@ -26,13 +24,9 @@ $dom2 = new DOMDocument();
$dom2->loadXML($xml2);
$root2 = $dom2->documentElement;
try {
$root2->setAttributeNode($attr);
$root2->setAttributeNode($attr);
} catch (domexception $e) {
ob_start();
var_dump($e);
$contents = ob_get_contents();
ob_end_clean();
echo preg_replace('/object\(DOMAttr\).+\{.*?\}/s', 'DOMAttr', $contents);
var_dump($e);
}
?>
@@ -63,7 +57,8 @@ object(DOMException)#%d (7) {
["args"]=>
array(1) {
[0]=>
DOMAttr
object(DOMAttr)#%d (0) {
}
}
}
}
@@ -1,59 +0,0 @@
--TEST--
Objects of DOM extension: debug info object handler.
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$xml = <<<XML
<foo>
<bar>foobar</bar>
</foo>
XML;
$d = new domdocument;
$d->dynamicProperty = new stdclass;
$d->loadXML($xml);
print_r($d);
--EXPECTF--
DOMDocument Object
(
[dynamicProperty] => stdClass Object
(
)
[doctype] =>
[implementation] => (object value omitted)
[documentElement] => (object value omitted)
[actualEncoding] =>
[encoding] =>
[xmlEncoding] =>
[standalone] => 1
[xmlStandalone] => 1
[version] => 1.0
[xmlVersion] => 1.0
[strictErrorChecking] => 1
[documentURI] => %s
[config] =>
[formatOutput] =>
[validateOnParse] =>
[resolveExternals] =>
[preserveWhiteSpace] => 1
[recover] =>
[substituteEntities] =>
[nodeName] => #document
[nodeValue] =>
[nodeType] => 9
[parentNode] =>
[childNodes] => (object value omitted)
[firstChild] => (object value omitted)
[lastChild] => (object value omitted)
[previousSibling] =>
[attributes] =>
[ownerDocument] =>
[namespaceURI] =>
[prefix] =>
[localName] =>
[baseURI] => %s
[textContent] =>
foobar
)
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!ELEMENT note (to,from,heading,body)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE note SYSTEM "note.dtd">
<note>
<to>PHP User Group</to>
<from>Shane</from>
<heading>Reminder</heading>
<body>Don't forget the meeting tonight!</body>
</note>
+9 -6
View File
@@ -18,23 +18,26 @@ $doc->registerNodeClass('DOMElement', 'myElement');
$doc->appendChild(new DOMElement('root'));
$root = $doc->documentElement;
$root->setAttribute('a', 'a1');
echo get_class($root), "\n";
var_dump($root);
print $root->testit()."\n";
$attr = $root->getAttributeNode('a');
echo get_class($attr), "\n";
var_dump($attr);
print $attr->testit()."\n";
unset($attr);
$doc->registerNodeClass('DOMAttr', NULL);
$attr = $root->getAttributeNode('a');
echo get_class($attr), "\n";
var_dump($attr);
print $attr->testit()."\n";
?>
--EXPECTF--
myElement
object(myElement)#%d (0) {
}
HELLO Element
myAttribute
object(myAttribute)#%d (0) {
}
HELLO Attribute
DOMAttr
object(DOMAttr)#%d (0) {
}
Fatal error: Call to undefined method DOMAttr::testit() in %s on line 25
+1 -1
View File
@@ -326,7 +326,7 @@ PHP_MINFO_FUNCTION(enchant)
#elif defined(HAVE_ENCHANT_BROKER_SET_PARAM)
php_info_print_table_row(2, "Libenchant Version", "1.5.0 or later");
#endif
php_info_print_table_row(2, "Revision", "$Id$");
php_info_print_table_row(2, "Revision", "$Revision$");
php_info_print_table_end();
php_info_print_table_start();
+81216 -114243
View File
File diff suppressed because it is too large. Load diff
+8 -35
View File
@@ -76,9 +76,9 @@ struct finfo_object {
} \
}
/* {{{ finfo_objects_free
/* {{{ finfo_objects_dtor
*/
static void finfo_objects_free(void *object TSRMLS_DC)
static void finfo_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC)
{
struct finfo_object *intern = (struct finfo_object *) object;
@@ -108,8 +108,7 @@ PHP_FILEINFO_API zend_object_value finfo_objects_new(zend_class_entry *class_typ
intern->ptr = NULL;
retval.handle = zend_objects_store_put(intern, NULL,
finfo_objects_free, NULL TSRMLS_CC);
retval.handle = zend_objects_store_put(intern, finfo_objects_dtor, NULL, NULL TSRMLS_CC);
retval.handlers = (zend_object_handlers *) &finfo_object_handlers;
return retval;
@@ -277,15 +276,6 @@ PHP_MINFO_FUNCTION(fileinfo)
}
/* }}} */
#define FILEINFO_DESTROY_OBJECT(object) \
do { \
if (object) { \
zend_object_store_ctor_failed(object TSRMLS_CC); \
zval_dtor(object); \
ZVAL_NULL(object); \
} \
} while (0)
/* {{{ proto resource finfo_open([int options [, string arg]])
Create a new fileinfo resource. */
PHP_FUNCTION(finfo_open)
@@ -298,7 +288,6 @@ PHP_FUNCTION(finfo_open)
char resolved_path[MAXPATHLEN];
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &options, &file, &file_len) == FAILURE) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
@@ -316,11 +305,9 @@ PHP_FUNCTION(finfo_open)
file = NULL;
} else if (file && *file) { /* user specified file, perform open_basedir checks */
if (strlen(file) != file_len) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
if (!VCWD_REALPATH(file, resolved_path)) {
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
file = resolved_path;
@@ -330,7 +317,6 @@ PHP_FUNCTION(finfo_open)
#else
if (php_check_open_basedir(file TSRMLS_CC)) {
#endif
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
}
@@ -343,23 +329,21 @@ PHP_FUNCTION(finfo_open)
if (finfo->magic == NULL) {
efree(finfo);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid mode '%ld'.", options);
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
RETURN_FALSE;
}
if (magic_load(finfo->magic, file) == -1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to load magic database at '%s'.", file);
magic_close(finfo->magic);
efree(finfo);
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
}
if (object) {
FILEINFO_REGISTER_OBJECT(object, finfo);
} else {
ZEND_REGISTER_RESOURCE(return_value, finfo, le_fileinfo);
}
}
}
/* }}} */
@@ -515,22 +499,11 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC);
if (wrap) {
php_stream *stream;
php_stream_context *context = php_stream_context_from_zval(zcontext, 0);
#ifdef PHP_WIN32
if (php_stream_stat_path_ex(buffer, 0, &ssb, context) == SUCCESS) {
if (ssb.sb.st_mode & S_IFDIR) {
ret_val = mime_directory;
goto common;
}
}
#endif
#if PHP_API_VERSION < 20100412
stream = php_stream_open_wrapper_ex(buffer, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
#else
stream = php_stream_open_wrapper_ex(buffer, "rb", REPORT_ERRORS, NULL, context);
php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb", REPORT_ERRORS, NULL, context);
#endif
if (!stream) {
File diff suppressed because it is too large. Load diff
+81 -272
View File
@@ -34,7 +34,7 @@
#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: apprentice.c,v 1.173 2011/12/08 12:38:24 rrt Exp $")
FILE_RCSID("@(#)$File: apprentice.c,v 1.151 2009/03/18 15:19:23 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -89,6 +89,10 @@ FILE_RCSID("@(#)$File: apprentice.c,v 1.173 2011/12/08 12:38:24 rrt Exp $")
#define MAP_FILE 0
#endif
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
#endif
struct magic_entry {
struct magic *mp;
uint32_t cont_count;
@@ -110,7 +114,6 @@ private void eatsize(const char **);
private int apprentice_1(struct magic_set *, const char *, int, struct mlist *);
private size_t apprentice_magic_strength(const struct magic *);
private int apprentice_sort(const void *, const void *);
private void apprentice_list(struct mlist *, int );
private int apprentice_load(struct magic_set *, struct magic **, uint32_t *,
const char *, int);
private void byteswap(struct magic *, uint32_t);
@@ -297,13 +300,6 @@ apprentice_1(struct magic_set *ms, const char *fn, int action,
ml->next = mlist;
mlist->prev = ml;
if (action == FILE_LIST) {
printf("Binary patterns:\n");
apprentice_list(mlist, BINTEST);
printf("Text patterns:\n");
apprentice_list(mlist, TEXTTEST);
}
return 0;
}
@@ -337,11 +333,6 @@ file_apprentice(struct magic_set *ms, const char *fn, int action)
char *p, *mfn;
int file_err, errs = -1;
struct mlist *mlist;
/* XXX disabling default magic loading so the compiled in data is used */
#if 0
if ((fn = magic_getpath(fn, action)) == NULL)
return NULL;
#endif
init_file_tables();
@@ -538,43 +529,6 @@ apprentice_sort(const void *a, const void *b)
return 1;
}
/*
* Shows sorted patterns list in the order which is used for the matching
*/
private void
apprentice_list(struct mlist *mlist, int mode)
{
uint32_t magindex = 0;
struct mlist *ml;
for (ml = mlist->next; ml != mlist; ml = ml->next) {
for (magindex = 0; magindex < ml->nmagic; magindex++) {
struct magic *m = &ml->magic[magindex];
if ((m->flag & mode) != mode) {
/* Skip sub-tests */
while (magindex + 1 < ml->nmagic &&
ml->magic[magindex + 1].cont_level != 0)
++magindex;
continue; /* Skip to next top-level test*/
}
/*
* Try to iterate over the tree until we find item with
* description/mimetype.
*/
while (magindex + 1 < ml->nmagic &&
ml->magic[magindex + 1].cont_level != 0 &&
*ml->magic[magindex].desc == '\0' &&
*ml->magic[magindex].mimetype == '\0')
magindex++;
printf("Strength = %3" SIZE_T_FORMAT "u : %s [%s]\n",
apprentice_magic_strength(m),
ml->magic[magindex].desc,
ml->magic[magindex].mimetype);
}
}
}
private void
set_test_type(struct magic *mstart, struct magic *m)
{
@@ -610,35 +564,19 @@ set_test_type(struct magic *mstart, struct magic *m)
case FILE_DOUBLE:
case FILE_BEDOUBLE:
case FILE_LEDOUBLE:
mstart->flag |= BINTEST;
break;
case FILE_STRING:
case FILE_PSTRING:
case FILE_BESTRING16:
case FILE_LESTRING16:
/* Allow text overrides */
if (mstart->str_flags & STRING_TEXTTEST)
mstart->flag |= TEXTTEST;
else
mstart->flag |= BINTEST;
/* binary test, set flag */
mstart->flag |= BINTEST;
break;
case FILE_REGEX:
case FILE_SEARCH:
/* Check for override */
if (mstart->str_flags & STRING_BINTEST)
mstart->flag |= BINTEST;
if (mstart->str_flags & STRING_TEXTTEST)
mstart->flag |= TEXTTEST;
if (mstart->flag & (TEXTTEST|BINTEST))
break;
/* binary test if pattern is not text */
if (file_looks_utf8(m->value.us, (size_t)m->vallen, NULL,
NULL) <= 0)
mstart->flag |= BINTEST;
else
mstart->flag |= TEXTTEST;
break;
case FILE_DEFAULT:
/* can't deduce anything; we shouldn't see this at the
@@ -659,8 +597,8 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs,
struct magic_entry **marray, uint32_t *marraycount)
{
char buffer[BUFSIZ + 1];
char *line = NULL;
size_t len;
char *line;
size_t line_len;
size_t lineno = 0;
php_stream *stream;
@@ -678,31 +616,31 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs,
file_error(ms, errno, "cannot read magic file `%s'",
fn);
(*errs)++;
return;
}
} else {
/* read and parse this file */
#if (PHP_MAJOR_VERSION < 6)
for (ms->line = 1; (line = php_stream_get_line(stream, buffer , BUFSIZ, &len)) != NULL; ms->line++) {
for (ms->line = 1; (line = php_stream_get_line(stream, buffer , BUFSIZ, &line_len)) != NULL; ms->line++) {
#else
for (ms->line = 1; (line = php_stream_get_line(stream, ZSTR(buffer), BUFSIZ, &len)) != NULL; ms->line++) {
for (ms->line = 1; (line = php_stream_get_line(stream, ZSTR(buffer), BUFSIZ, &line_len)) != NULL; ms->line++) {
#endif
if (len == 0) /* null line, garbage, etc */
continue;
if (line[len - 1] == '\n') {
lineno++;
line[len - 1] = '\0'; /* delete newline */
}
switch (line[0]) {
case '\0': /* empty, do not parse */
case '#': /* comment, do not parse */
continue;
case '!':
if (line[1] == ':') {
if (line_len == 0) /* null line, garbage, etc */
continue;
if (line[line_len - 1] == '\n') {
lineno++;
line[line_len - 1] = '\0'; /* delete newline */
}
if (line[0] == '\0') /* empty, do not parse */
continue;
if (line[0] == '#') /* comment, do not parse */
continue;
if (line[0] == '!' && line[1] == ':') {
size_t i;
for (i = 0; bang[i].name != NULL; i++) {
if ((size_t)(len - 2) > bang[i].len &&
if (line_len - 2 > bang[i].len &&
memcmp(bang[i].name, line + 2,
bang[i].len) == 0)
break;
@@ -728,27 +666,18 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs,
}
continue;
}
/*FALLTHROUGH*/
default:
if (parse(ms, marray, marraycount, line, lineno,
action) != 0)
if (parse(ms, marray, marraycount, line, lineno, action) != 0)
(*errs)++;
break;
}
php_stream_close(stream);
}
php_stream_close(stream);
}
/*
* parse a file or directory of files
* const char *fn: name of magic file or directory
*/
private int
cmpstrp(const void *p1, const void *p2)
{
return strcmp(*(char *const *)p1, *(char *const *)p2);
}
private int
apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
const char *fn, int action)
@@ -756,8 +685,7 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
int errs = 0;
struct magic_entry *marray;
uint32_t marraycount, i, mentrycount = 0, starttest;
size_t files = 0, maxfiles = 0;
char **filearr = NULL, mfn[MAXPATHLEN];
char subfn[MAXPATHLEN];
struct stat st;
DIR *dir;
struct dirent *d;
@@ -777,43 +705,19 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
non-determinism. See Debian bug #488562. */
if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
dir = opendir(fn);
if (!dir) {
errs++;
goto out;
}
while ((d = readdir(dir)) != NULL) {
if (snprintf(mfn, sizeof(mfn), "%s/%s", fn, d->d_name) < 0) {
file_oomem(ms,
strlen(fn) + strlen(d->d_name) + 2);
errs++;
closedir(dir);
goto out;
}
if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
continue;
}
if (files >= maxfiles) {
size_t mlen;
maxfiles = (maxfiles + 1) * 2;
mlen = maxfiles * sizeof(*filearr);
if ((filearr = CAST(char **,
realloc(filearr, mlen))) == NULL) {
file_oomem(ms, mlen);
closedir(dir);
errs++;
goto out;
if (dir) {
while ((d = readdir(dir)) != NULL) {
snprintf(subfn, sizeof(subfn), "%s/%s",
fn, d->d_name);
if (stat(subfn, &st) == 0 &&
S_ISREG(st.st_mode)) {
load_1(ms, action, subfn, &errs,
&marray, &marraycount);
}
}
filearr[files++] = mfn;
}
closedir(dir);
qsort(filearr, files, sizeof(*filearr), cmpstrp);
for (i = 0; i < files; i++) {
load_1(ms, action, filearr[i], &errs, &marray,
&marraycount);
free(filearr[i]);
}
free(filearr);
closedir(dir);
} else
errs++;
} else
load_1(ms, action, fn, &errs, &marray, &marraycount);
if (errs)
@@ -865,8 +769,7 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
if (marray[i].mp->cont_level == 0)
break;
if (i != marraycount) {
/* XXX - Ugh! */
ms->line = marray[i].mp->lineno;
ms->line = marray[i].mp->lineno; /* XXX - Ugh! */
file_magwarn(ms,
"level 0 \"default\" did not sort last");
}
@@ -977,11 +880,6 @@ string_modifier_check(struct magic_set *ms, struct magic *m)
if ((ms->flags & MAGIC_CHECK) == 0)
return 0;
if (m->type != FILE_PSTRING && (m->str_flags & PSTRING_LEN) != 0) {
file_magwarn(ms,
"'/BHhLl' modifiers are only allowed for pascal strings\n");
return -1;
}
switch (m->type) {
case FILE_BESTRING16:
case FILE_LESTRING16:
@@ -1010,14 +908,14 @@ string_modifier_check(struct magic_set *ms, struct magic *m)
}
break;
case FILE_REGEX:
if ((m->str_flags & STRING_COMPACT_WHITESPACE) != 0) {
if ((m->str_flags & STRING_COMPACT_BLANK) != 0) {
file_magwarn(ms, "'/%c' not allowed on regex\n",
CHAR_COMPACT_WHITESPACE);
CHAR_COMPACT_BLANK);
return -1;
}
if ((m->str_flags & STRING_COMPACT_OPTIONAL_WHITESPACE) != 0) {
if ((m->str_flags & STRING_COMPACT_OPTIONAL_BLANK) != 0) {
file_magwarn(ms, "'/%c' not allowed on regex\n",
CHAR_COMPACT_OPTIONAL_WHITESPACE);
CHAR_COMPACT_OPTIONAL_BLANK);
return -1;
}
break;
@@ -1170,7 +1068,7 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
size_t cnt = me->max_count + ALLOC_CHUNK;
nm = erealloc(me->mp, sizeof(*nm) * cnt);
me->mp = m = nm;
me->max_count = CAST(uint32_t, cnt);
me->max_count = cnt;
}
m = &me->mp[me->cont_count++];
(void)memset(m, 0, sizeof(*m));
@@ -1196,7 +1094,7 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
m->cont_level = 0;
me->cont_count = 1;
}
m->lineno = CAST(uint32_t, lineno);
m->lineno = lineno;
if (*l == '&') { /* m->cont_level == 0 checked below. */
++l; /* step over */
@@ -1344,7 +1242,8 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
++l;
}
m->str_range = 0;
m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0;
m->str_flags = 0;
m->num_mask = 0;
if ((op = get_op(*l)) != -1) {
if (!IS_LIBMAGIC_STRING(m->type)) {
uint64_t val;
@@ -1368,20 +1267,18 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
file_magwarn(ms,
"multiple ranges");
have_range = 1;
m->str_range = CAST(uint32_t,
strtoul(l, &t, 0));
m->str_range = strtoul(l, &t, 0);
if (m->str_range == 0)
file_magwarn(ms,
"zero range");
l = t - 1;
break;
case CHAR_COMPACT_WHITESPACE:
m->str_flags |=
STRING_COMPACT_WHITESPACE;
case CHAR_COMPACT_BLANK:
m->str_flags |= STRING_COMPACT_BLANK;
break;
case CHAR_COMPACT_OPTIONAL_WHITESPACE:
case CHAR_COMPACT_OPTIONAL_BLANK:
m->str_flags |=
STRING_COMPACT_OPTIONAL_WHITESPACE;
STRING_COMPACT_OPTIONAL_BLANK;
break;
case CHAR_IGNORE_LOWERCASE:
m->str_flags |= STRING_IGNORE_LOWERCASE;
@@ -1392,48 +1289,11 @@ parse(struct magic_set *ms, struct magic_entry **mentryp, uint32_t *nmentryp,
case CHAR_REGEX_OFFSET_START:
m->str_flags |= REGEX_OFFSET_START;
break;
case CHAR_BINTEST:
m->str_flags |= STRING_BINTEST;
break;
case CHAR_TEXTTEST:
m->str_flags |= STRING_TEXTTEST;
break;
case CHAR_PSTRING_1_LE:
if (m->type != FILE_PSTRING)
goto bad;
m->str_flags = (m->str_flags & ~PSTRING_LEN) | PSTRING_1_LE;
break;
case CHAR_PSTRING_2_BE:
if (m->type != FILE_PSTRING)
goto bad;
m->str_flags = (m->str_flags & ~PSTRING_LEN) | PSTRING_2_BE;
break;
case CHAR_PSTRING_2_LE:
if (m->type != FILE_PSTRING)
goto bad;
m->str_flags = (m->str_flags & ~PSTRING_LEN) | PSTRING_2_LE;
break;
case CHAR_PSTRING_4_BE:
if (m->type != FILE_PSTRING)
goto bad;
m->str_flags = (m->str_flags & ~PSTRING_LEN) | PSTRING_4_BE;
break;
case CHAR_PSTRING_4_LE:
if (m->type != FILE_PSTRING)
goto bad;
m->str_flags = (m->str_flags & ~PSTRING_LEN) | PSTRING_4_LE;
break;
case CHAR_PSTRING_LENGTH_INCLUDES_ITSELF:
if (m->type != FILE_PSTRING)
goto bad;
m->str_flags |= PSTRING_LENGTH_INCLUDES_ITSELF;
break;
default:
bad:
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms,
"string extension `%c' "
"invalid", *l);
"string extension `%c' invalid",
*l);
return -1;
}
/* allow multiple '/' for readability */
@@ -1595,8 +1455,7 @@ out:
}
/*
* Parse an Apple CREATOR/TYPE annotation from magic file and put it into
* magic[index - 1]
* Parse an Apple CREATOR/TYPE annotation from magic file and put it into magic[index - 1]
*/
private int
parse_apple(struct magic_set *ms, struct magic_entry *me, const char *line)
@@ -1606,21 +1465,19 @@ parse_apple(struct magic_set *ms, struct magic_entry *me, const char *line)
struct magic *m = &me->mp[me->cont_count == 0 ? 0 : me->cont_count - 1];
if (m->apple[0] != '\0') {
file_magwarn(ms, "Current entry already has a APPLE type "
"`%.8s', new type `%s'", m->mimetype, l);
file_magwarn(ms, "Current entry already has a APPLE type `%.8s',"
" new type `%s'", m->mimetype, l);
return -1;
}
EATAB;
for (i = 0; *l && ((isascii((unsigned char)*l) &&
isalnum((unsigned char)*l)) || strchr("-+/.", *l)) &&
i < sizeof(m->apple); m->apple[i++] = *l++)
for (i = 0; *l && ((isascii((unsigned char)*l) && isalnum((unsigned char)*l))
|| strchr("-+/.", *l)) && i < sizeof(m->apple); m->apple[i++] = *l++)
continue;
if (i == sizeof(m->apple) && *l) {
/* We don't need to NUL terminate here, printing handles it */
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "APPLE type `%s' truncated %"
SIZE_T_FORMAT "u", line, i);
file_magwarn(ms, "APPLE type `%s' truncated %zu",
line, i);
}
if (i > 0)
@@ -1647,15 +1504,14 @@ parse_mime(struct magic_set *ms, struct magic_entry *me, const char *line)
}
EATAB;
for (i = 0; *l && ((isascii((unsigned char)*l) &&
isalnum((unsigned char)*l)) || strchr("-+/.", *l)) &&
i < sizeof(m->mimetype); m->mimetype[i++] = *l++)
for (i = 0; *l && ((isascii((unsigned char)*l) && isalnum((unsigned char)*l))
|| strchr("-+/.", *l)) && i < sizeof(m->mimetype); m->mimetype[i++] = *l++)
continue;
if (i == sizeof(m->mimetype)) {
m->mimetype[sizeof(m->mimetype) - 1] = '\0';
m->desc[sizeof(m->mimetype) - 1] = '\0';
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "MIME type `%s' truncated %"
SIZE_T_FORMAT "u", m->mimetype, i);
file_magwarn(ms, "MIME type `%s' truncated %zu",
m->mimetype, i);
} else
m->mimetype[i] = '\0';
@@ -1944,10 +1800,8 @@ getstr(struct magic_set *ms, struct magic *m, const char *s, int warn)
if (isprint((unsigned char)c)) {
/* Allow escaping of
* ``relations'' */
if (strchr("<>&^=!", c) == NULL
&& (m->type != FILE_REGEX ||
strchr("[]().*?^$|{}", c)
== NULL)) {
if (strchr("<>&^=!", c)
== NULL) {
file_magwarn(ms, "no "
"need to escape "
"`%c'", c);
@@ -2055,9 +1909,9 @@ getstr(struct magic_set *ms, struct magic *m, const char *s, int warn)
}
out:
*p = '\0';
m->vallen = CAST(unsigned char, (p - origp));
m->vallen = p - origp;
if (m->type == FILE_PSTRING)
m->vallen += (unsigned char)file_pstring_length_size(m);
m->vallen++;
return s;
}
@@ -2087,15 +1941,14 @@ file_showstr(FILE *fp, const char *s, size_t len)
char c;
for (;;) {
c = *s++;
if (len == ~0U) {
c = *s++;
if (c == '\0')
break;
}
else {
if (len-- == 0)
break;
c = *s++;
}
if (c >= 040 && c <= 0176) /* TODO isprint && !iscntrl */
(void) fputc(c, fp);
@@ -2217,11 +2070,11 @@ apprentice_map(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
}
mm = emalloc((size_t)st.sb.st_size);
ret = 1;
if (php_stream_read(stream, mm, (size_t)st.sb.st_size) != (size_t)st.sb.st_size) {
file_badread(ms);
goto error1;
}
ret = 1;
php_stream_close(stream);
stream = NULL;
@@ -2235,12 +2088,15 @@ internal_loaded:
goto error1;
}
needsbyteswap = 1;
} else
} else {
needsbyteswap = 0;
}
if (needsbyteswap)
version = swap4(ptr[1]);
else
version = ptr[1];
if (version != VERSIONNO) {
file_error(ms, 0, "File %d.%d supports only version %d magic "
"files. `%s' is version %d", FILE_VERSION_MAJOR, patchlevel,
@@ -2312,8 +2168,9 @@ apprentice_compile(struct magic_set *ms, struct magic **magicp,
dbname = mkdbname(ms, fn, 0);
if (dbname == NULL)
if (dbname == NULL) {
goto out;
}
/* wb+ == O_WRONLY|O_CREAT|O_TRUNC|O_BINARY */
#if PHP_API_VERSION < 20100412
@@ -2487,51 +2344,3 @@ bs1(struct magic *m)
m->num_mask = swap8(m->num_mask);
}
}
protected size_t
file_pstring_length_size(const struct magic *m)
{
switch (m->str_flags & PSTRING_LEN) {
case PSTRING_1_LE:
return 1;
case PSTRING_2_LE:
case PSTRING_2_BE:
return 2;
case PSTRING_4_LE:
case PSTRING_4_BE:
return 4;
default:
abort(); /* Impossible */
return 1;
}
}
protected size_t
file_pstring_get_length(const struct magic *m, const char *s)
{
size_t len = 0;
switch (m->str_flags & PSTRING_LEN) {
case PSTRING_1_LE:
len = *s;
break;
case PSTRING_2_LE:
len = (s[1] << 8) | s[0];
break;
case PSTRING_2_BE:
len = (s[0] << 8) | s[1];
break;
case PSTRING_4_LE:
len = (s[3] << 24) | (s[2] << 16) | (s[1] << 8) | s[0];
break;
case PSTRING_4_BE:
len = (s[0] << 24) | (s[1] << 16) | (s[2] << 8) | s[3];
break;
default:
abort(); /* Impossible */
}
if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF)
len -= file_pstring_length_size(m);
return len;
}
+1 -2
View File
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: apptype.c,v 1.13 2011/09/07 21:57:15 christos Exp $")
FILE_RCSID("@(#)$File: apptype.c,v 1.11 2009/02/04 18:24:32 christos Exp $")
#endif /* lint */
#include <stdlib.h>
@@ -72,7 +72,6 @@ file_os2_apptype(struct magic_set *ms, const char *fn, const void *buf,
if (fwrite(buf, 1, nb, fp) != nb) {
file_error(ms, errno, "cannot write tmp file `%s'",
path);
(void)fclose(fp);
return -1;
}
(void)fclose(fp);
+79 -50
View File
@@ -26,7 +26,8 @@
* SUCH DAMAGE.
*/
/*
* ASCII magic -- try to detect text encoding.
* ASCII magic -- file types that we know based on keywords
* that can appear anywhere in the file.
*
* Extensively modified by Eric Fischer <enf@pobox.com> in July, 2000,
* to handle character codes other than ASCII on a unified basis.
@@ -35,7 +36,7 @@
#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: ascmagic.c,v 1.84 2011/12/08 12:38:24 rrt Exp $")
FILE_RCSID("@(#)$File: ascmagic.c,v 1.75 2009/02/03 20:27:51 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -46,11 +47,13 @@ FILE_RCSID("@(#)$File: ascmagic.c,v 1.84 2011/12/08 12:38:24 rrt Exp $")
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "names.h"
#define MAXLINELEN 300 /* longest sane line length */
#define ISSPC(x) ((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n' \
|| (x) == 0x85 || (x) == '\f')
private int ascmatch(const unsigned char *, const unichar *, size_t);
private unsigned char *encode_utf8(unsigned char *, size_t, unichar *, size_t);
private size_t trim_nuls(const unsigned char *, size_t);
@@ -68,8 +71,7 @@ trim_nuls(const unsigned char *buf, size_t nbytes)
}
protected int
file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
int text)
file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes)
{
unichar *ubuf = NULL;
size_t ulen;
@@ -86,13 +88,17 @@ file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
/* If file doesn't look like any sort of text, give up. */
if (file_encoding(ms, buf, nbytes, &ubuf, &ulen, &code, &code_mime,
&type) == 0)
&type) == 0) {
rv = 0;
else
rv = file_ascmagic_with_encoding(ms, buf, nbytes, ubuf, ulen, code,
type, text);
goto done;
}
free(ubuf);
rv = file_ascmagic_with_encoding(ms, buf, nbytes, ubuf, ulen, code,
type);
done:
if (ubuf)
free(ubuf);
return rv;
}
@@ -100,10 +106,11 @@ file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
protected int
file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
size_t nbytes, unichar *ubuf, size_t ulen, const char *code,
const char *type, int text)
const char *type)
{
unsigned char *utf8_buf = NULL, *utf8_end;
size_t mlen, i;
const struct names *p;
int rv = -1;
int mime = ms->flags & MAGIC_MIME;
@@ -118,7 +125,6 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
int n_lf = 0;
int n_cr = 0;
int n_nel = 0;
int executable = 0;
size_t last_line_end = (size_t)-1;
int has_long_lines = 0;
@@ -134,21 +140,54 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
goto done;
}
if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) {
/* Convert ubuf to UTF-8 and try text soft magic */
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
mlen = ulen * 6;
utf8_buf = emalloc(mlen);
/* Convert ubuf to UTF-8 and try text soft magic */
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
mlen = ulen * 6;
utf8_buf = emalloc(mlen);
if ((utf8_end = encode_utf8(utf8_buf, mlen, ubuf, ulen))
== NULL)
goto done;
if ((rv = file_softmagic(ms, utf8_buf,
(size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0)
rv = -1;
if ((utf8_end = encode_utf8(utf8_buf, mlen, ubuf, ulen)) == NULL)
goto done;
if ((rv = file_softmagic(ms, utf8_buf, (size_t)(utf8_end - utf8_buf),
TEXTTEST)) != 0)
goto done;
else
rv = -1;
/* look for tokens from names.h - this is expensive! */
if ((ms->flags & MAGIC_NO_CHECK_TOKENS) != 0)
goto subtype_identified;
i = 0;
while (i < ulen) {
size_t end;
/* skip past any leading space */
while (i < ulen && ISSPC(ubuf[i]))
i++;
if (i >= ulen)
break;
/* find the next whitespace */
for (end = i + 1; end < nbytes; end++)
if (ISSPC(ubuf[end]))
break;
/* compare the word thus isolated against the token list */
for (p = names; p < names + NNAMES; p++) {
if (ascmatch((const unsigned char *)p->name, ubuf + i,
end - i)) {
subtype = types[p->type].human;
subtype_mime = types[p->type].mime;
goto subtype_identified;
}
}
i = end;
}
subtype_identified:
/* Now try to discover other details about the file. */
for (i = 0; i < ulen; i++) {
if (ubuf[i] == '\n') {
@@ -191,7 +230,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
goto done;
}
if (mime) {
if (!file_printedlen(ms) && (mime & MAGIC_MIME_TYPE) != 0) {
if ((mime & MAGIC_MIME_TYPE) != 0) {
if (subtype_mime) {
if (file_printf(ms, "%s", subtype_mime) == -1)
goto done;
@@ -201,28 +240,6 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
}
}
} else {
if (file_printedlen(ms)) {
switch (file_replace(ms, " text$", ", ")) {
case 0:
switch (file_replace(ms, " text executable$",
", ")) {
case 0:
if (file_printf(ms, ", ") == -1)
goto done;
case -1:
goto done;
default:
executable = 1;
break;
}
break;
case -1:
goto done;
default:
break;
}
}
if (file_printf(ms, "%s", code) == -1)
goto done;
@@ -234,10 +251,6 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
if (file_printf(ms, " %s", type) == -1)
goto done;
if (executable)
if (file_printf(ms, " executable") == -1)
goto done;
if (has_long_lines)
if (file_printf(ms, ", with very long lines") == -1)
goto done;
@@ -300,6 +313,22 @@ done:
return rv;
}
private int
ascmatch(const unsigned char *s, const unichar *us, size_t ulen)
{
size_t i;
for (i = 0; i < ulen; i++) {
if (s[i] != us[i])
return 0;
}
if (s[i])
return 0;
else
return 1;
}
/*
* Encode Unicode string as UTF-8, returning pointer to character
* after end of string, or NULL if an invalid character is found.
+138 -249
View File
@@ -24,18 +24,15 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Parse Composite Document Files, the format used in Microsoft Office
* document files before they switched to zipped XML.
* Parse composite document files, the format used in Microsoft Office
* document files before they switched to zipped xml.
* Info from: http://sc.openoffice.org/compdocfileformat.pdf
*
* N.B. This is the "Composite Document File" format, and not the
* "Compound Document Format", nor the "Channel Definition Format".
*/
#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: cdf.c,v 1.50 2012/02/20 22:35:29 christos Exp $")
FILE_RCSID("@(#)$File: cdf.c,v 1.30 2009/05/06 14:29:47 christos Exp $")
#endif
#include <assert.h>
@@ -57,9 +54,6 @@ FILE_RCSID("@(#)$File: cdf.c,v 1.50 2012/02/20 22:35:29 christos Exp $")
#include <string.h>
#include <time.h>
#include <ctype.h>
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifndef EFTYPE
#define EFTYPE EINVAL
@@ -67,6 +61,10 @@ FILE_RCSID("@(#)$File: cdf.c,v 1.50 2012/02/20 22:35:29 christos Exp $")
#include "cdf.h"
#ifndef __arraycount
#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
#endif
#ifdef CDF_DEBUG
#define DPRINTF(a) printf a, fflush(stdout)
#else
@@ -80,21 +78,19 @@ static union {
#define NEED_SWAP (cdf_bo.u == (uint32_t)0x01020304)
#define CDF_TOLE8(x) ((uint64_t)(NEED_SWAP ? _cdf_tole8(x) : (uint64_t)(x)))
#define CDF_TOLE4(x) ((uint32_t)(NEED_SWAP ? _cdf_tole4(x) : (uint32_t)(x)))
#define CDF_TOLE2(x) ((uint16_t)(NEED_SWAP ? _cdf_tole2(x) : (uint16_t)(x)))
#define CDF_GETUINT32(x, y) cdf_getuint32(x, y)
#define CDF_TOLE8(x) (NEED_SWAP ? cdf_tole8(x) : (uint64_t)(x))
#define CDF_TOLE4(x) (NEED_SWAP ? cdf_tole4(x) : (uint32_t)(x))
#define CDF_TOLE2(x) (NEED_SWAP ? cdf_tole2(x) : (uint16_t)(x))
/*
* swap a short
*/
static uint16_t
_cdf_tole2(uint16_t sv)
uint16_t
cdf_tole2(uint16_t sv)
{
uint16_t rv;
uint8_t *s = (uint8_t *)(void *)&sv;
uint8_t *d = (uint8_t *)(void *)&rv;
uint8_t *s = (uint8_t *)(void *)&sv;
uint8_t *d = (uint8_t *)(void *)&rv;
d[0] = s[1];
d[1] = s[0];
return rv;
@@ -103,12 +99,12 @@ _cdf_tole2(uint16_t sv)
/*
* swap an int
*/
static uint32_t
_cdf_tole4(uint32_t sv)
uint32_t
cdf_tole4(uint32_t sv)
{
uint32_t rv;
uint8_t *s = (uint8_t *)(void *)&sv;
uint8_t *d = (uint8_t *)(void *)&rv;
uint8_t *s = (uint8_t *)(void *)&sv;
uint8_t *d = (uint8_t *)(void *)&rv;
d[0] = s[3];
d[1] = s[2];
d[2] = s[1];
@@ -119,12 +115,12 @@ _cdf_tole4(uint32_t sv)
/*
* swap a quad
*/
static uint64_t
_cdf_tole8(uint64_t sv)
uint64_t
cdf_tole8(uint64_t sv)
{
uint64_t rv;
uint8_t *s = (uint8_t *)(void *)&sv;
uint8_t *d = (uint8_t *)(void *)&rv;
uint8_t *s = (uint8_t *)(void *)&sv;
uint8_t *d = (uint8_t *)(void *)&rv;
d[0] = s[7];
d[1] = s[6];
d[2] = s[5];
@@ -136,41 +132,11 @@ _cdf_tole8(uint64_t sv)
return rv;
}
/*
* grab a uint32_t from a possibly unaligned address, and return it in
* the native host order.
*/
static uint32_t
cdf_getuint32(const uint8_t *p, size_t offs)
{
uint32_t rv;
(void)memcpy(&rv, p + offs * sizeof(uint32_t), sizeof(rv));
return CDF_TOLE4(rv);
}
#define CDF_UNPACK(a) \
(void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
#define CDF_UNPACKA(a) \
(void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
uint16_t
cdf_tole2(uint16_t sv)
{
return CDF_TOLE2(sv);
}
uint32_t
cdf_tole4(uint32_t sv)
{
return CDF_TOLE4(sv);
}
uint64_t
cdf_tole8(uint64_t sv)
{
return CDF_TOLE8(sv);
}
void
cdf_swap_header(cdf_header_t *h)
{
@@ -189,15 +155,15 @@ cdf_swap_header(cdf_header_t *h)
h->h_min_size_standard_stream =
CDF_TOLE4(h->h_min_size_standard_stream);
h->h_secid_first_sector_in_short_sat =
CDF_TOLE4((uint32_t)h->h_secid_first_sector_in_short_sat);
CDF_TOLE4(h->h_secid_first_sector_in_short_sat);
h->h_num_sectors_in_short_sat =
CDF_TOLE4(h->h_num_sectors_in_short_sat);
h->h_secid_first_sector_in_master_sat =
CDF_TOLE4((uint32_t)h->h_secid_first_sector_in_master_sat);
CDF_TOLE4(h->h_secid_first_sector_in_master_sat);
h->h_num_sectors_in_master_sat =
CDF_TOLE4(h->h_num_sectors_in_master_sat);
for (i = 0; i < __arraycount(h->h_master_sat); i++)
h->h_master_sat[i] = CDF_TOLE4((uint32_t)h->h_master_sat[i]);
h->h_master_sat[i] = CDF_TOLE4(h->h_master_sat[i]);
}
void
@@ -230,15 +196,15 @@ void
cdf_swap_dir(cdf_directory_t *d)
{
d->d_namelen = CDF_TOLE2(d->d_namelen);
d->d_left_child = CDF_TOLE4((uint32_t)d->d_left_child);
d->d_right_child = CDF_TOLE4((uint32_t)d->d_right_child);
d->d_storage = CDF_TOLE4((uint32_t)d->d_storage);
d->d_left_child = CDF_TOLE4(d->d_left_child);
d->d_right_child = CDF_TOLE4(d->d_right_child);
d->d_storage = CDF_TOLE4(d->d_storage);
d->d_storage_uuid[0] = CDF_TOLE8(d->d_storage_uuid[0]);
d->d_storage_uuid[1] = CDF_TOLE8(d->d_storage_uuid[1]);
d->d_flags = CDF_TOLE4(d->d_flags);
d->d_created = CDF_TOLE8((uint64_t)d->d_created);
d->d_modified = CDF_TOLE8((uint64_t)d->d_modified);
d->d_stream_first_sector = CDF_TOLE4((uint32_t)d->d_stream_first_sector);
d->d_created = CDF_TOLE8(d->d_created);
d->d_modified = CDF_TOLE8(d->d_modified);
d->d_stream_first_sector = CDF_TOLE4(d->d_stream_first_sector);
d->d_size = CDF_TOLE4(d->d_size);
}
@@ -272,18 +238,14 @@ cdf_unpack_dir(cdf_directory_t *d, char *buf)
}
static int
cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h,
const void *p, size_t tail, int line)
cdf_check_stream_offset(const cdf_stream_t *sst, const void *p, size_t tail)
{
const char *b = (const char *)sst->sst_tab;
const char *e = ((const char *)p) + tail;
(void)&line;
if (e >= b && (size_t)(e - b) < CDF_SEC_SIZE(h) * sst->sst_len)
if (e >= b && (size_t)(e - b) < sst->sst_dirlen * sst->sst_len)
return 0;
DPRINTF(("%d: offset begin %p end %p %" SIZE_T_FORMAT "u"
" >= %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
CDF_SEC_SIZE(h) * sst->sst_len, CDF_SEC_SIZE(h), sst->sst_len));
DPRINTF((stderr, "offset begin %p end %p %zu >= %zu\n", b, e,
(size_t)(e - b), sst->sst_dirlen * sst->sst_len));
errno = EFTYPE;
return -1;
}
@@ -306,10 +268,10 @@ cdf_read(const cdf_info_t *info, off_t off, void *buf, size_t len)
if (info->i_fd == -1)
return -1;
if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (off_t)-1)
if (lseek(info->i_fd, off, SEEK_SET) == (off_t)-1)
return -1;
if (FINFO_READ_FUNC(info->i_fd, buf, len) != (ssize_t)len)
if (read(info->i_fd, buf, len) != (ssize_t)len)
return -1;
return (ssize_t)len;
@@ -326,8 +288,7 @@ cdf_read_header(const cdf_info_t *info, cdf_header_t *h)
cdf_unpack_header(h, buf);
cdf_swap_header(h);
if (h->h_magic != CDF_MAGIC) {
DPRINTF(("Bad magic 0x%" INT64_T_FORMAT "x != 0x%"
INT64_T_FORMAT "x\n",
DPRINTF(("Bad magic 0x%llx != 0x%llx\n",
(unsigned long long)h->h_magic,
(unsigned long long)CDF_MAGIC));
goto out;
@@ -352,27 +313,18 @@ ssize_t
cdf_read_sector(const cdf_info_t *info, void *buf, size_t offs, size_t len,
const cdf_header_t *h, cdf_secid_t id)
{
size_t ss = CDF_SEC_SIZE(h);
size_t pos = CDF_SEC_POS(h, id);
assert(ss == len);
return cdf_read(info, (off_t)pos, ((char *)buf) + offs, len);
assert((size_t)CDF_SEC_SIZE(h) == len);
return cdf_read(info, (off_t)CDF_SEC_POS(h, id),
((char *)buf) + offs, len);
}
ssize_t
cdf_read_short_sector(const cdf_stream_t *sst, void *buf, size_t offs,
size_t len, const cdf_header_t *h, cdf_secid_t id)
{
size_t ss = CDF_SHORT_SEC_SIZE(h);
size_t pos = CDF_SHORT_SEC_POS(h, id);
assert(ss == len);
if (pos > CDF_SEC_SIZE(h) * sst->sst_len) {
DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
SIZE_T_FORMAT "u\n",
pos, CDF_SEC_SIZE(h) * sst->sst_len));
return -1;
}
assert((size_t)CDF_SHORT_SEC_SIZE(h) == len);
(void)memcpy(((char *)buf) + offs,
((const char *)sst->sst_tab) + pos, len);
((const char *)sst->sst_tab) + CDF_SHORT_SEC_POS(h, id), len);
return len;
}
@@ -392,20 +344,17 @@ cdf_read_sat(const cdf_info_t *info, cdf_header_t *h, cdf_sat_t *sat)
break;
#define CDF_SEC_LIMIT (UINT32_MAX / (4 * ss))
if ((nsatpersec > 0 &&
h->h_num_sectors_in_master_sat > CDF_SEC_LIMIT / nsatpersec) ||
if (h->h_num_sectors_in_master_sat > CDF_SEC_LIMIT / nsatpersec ||
i > CDF_SEC_LIMIT) {
DPRINTF(("Number of sectors in master SAT too big %u %"
SIZE_T_FORMAT "u\n", h->h_num_sectors_in_master_sat, i));
DPRINTF(("Number of sectors in master SAT too big %u %zu\n",
h->h_num_sectors_in_master_sat, i));
errno = EFTYPE;
return -1;
}
sat->sat_len = h->h_num_sectors_in_master_sat * nsatpersec + i;
DPRINTF(("sat_len = %" SIZE_T_FORMAT "u ss = %" SIZE_T_FORMAT "u\n",
sat->sat_len, ss));
if ((sat->sat_tab = CAST(cdf_secid_t *, calloc(sat->sat_len, ss)))
== NULL)
DPRINTF(("sat_len = %zu ss = %zu\n", sat->sat_len, ss));
if ((sat->sat_tab = calloc(sat->sat_len, ss)) == NULL)
return -1;
for (i = 0; i < __arraycount(h->h_master_sat); i++) {
@@ -418,7 +367,7 @@ cdf_read_sat(const cdf_info_t *info, cdf_header_t *h, cdf_sat_t *sat)
}
}
if ((msa = CAST(cdf_secid_t *, calloc(1, ss))) == NULL)
if ((msa = calloc(1, ss)) == NULL)
goto out1;
mid = h->h_secid_first_sector_in_master_sat;
@@ -435,12 +384,12 @@ cdf_read_sat(const cdf_info_t *info, cdf_header_t *h, cdf_sat_t *sat)
goto out2;
}
for (k = 0; k < nsatpersec; k++, i++) {
sec = CDF_TOLE4((uint32_t)msa[k]);
sec = CDF_TOLE4(msa[k]);
if (sec < 0)
goto out;
if (i >= sat->sat_len) {
DPRINTF(("Out of bounds reading MSA %" SIZE_T_FORMAT
"u >= %" SIZE_T_FORMAT "u", i, sat->sat_len));
DPRINTF(("Out of bounds reading MSA %u >= %u",
i, sat->sat_len));
errno = EFTYPE;
goto out2;
}
@@ -451,7 +400,7 @@ cdf_read_sat(const cdf_info_t *info, cdf_header_t *h, cdf_sat_t *sat)
goto out2;
}
}
mid = CDF_TOLE4((uint32_t)msa[nsatpersec]);
mid = CDF_TOLE4(msa[nsatpersec]);
}
out:
sat->sat_len = i;
@@ -483,7 +432,7 @@ cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size)
errno = EFTYPE;
return (size_t)-1;
}
sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]);
sid = CDF_TOLE4(sat->sat_tab[sid]);
}
DPRINTF(("\n"));
return i;
@@ -513,8 +462,7 @@ cdf_read_long_sector_chain(const cdf_info_t *info, const cdf_header_t *h,
}
if (i >= scn->sst_len) {
DPRINTF(("Out of bounds reading long sector chain "
"%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i,
scn->sst_len));
"%u > %u\n", i, scn->sst_len));
errno = EFTYPE;
goto out;
}
@@ -527,7 +475,7 @@ cdf_read_long_sector_chain(const cdf_info_t *info, const cdf_header_t *h,
DPRINTF(("Reading long sector chain %d", sid));
goto out;
}
sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]);
sid = CDF_TOLE4(sat->sat_tab[sid]);
}
return 0;
out:
@@ -559,8 +507,7 @@ cdf_read_short_sector_chain(const cdf_header_t *h,
}
if (i >= scn->sst_len) {
DPRINTF(("Out of bounds reading short sector chain "
"%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n",
i, scn->sst_len));
"%u > %u\n", i, scn->sst_len));
errno = EFTYPE;
goto out;
}
@@ -569,7 +516,7 @@ cdf_read_short_sector_chain(const cdf_header_t *h,
DPRINTF(("Reading short sector chain %d", sid));
goto out;
}
sid = CDF_TOLE4((uint32_t)ssat->sat_tab[sid]);
sid = CDF_TOLE4(ssat->sat_tab[sid]);
}
return 0;
out:
@@ -583,7 +530,7 @@ cdf_read_sector_chain(const cdf_info_t *info, const cdf_header_t *h,
cdf_secid_t sid, size_t len, cdf_stream_t *scn)
{
if (len < h->h_min_size_standard_stream && sst->sst_tab != NULL)
if (len < h->h_min_size_standard_stream)
return cdf_read_short_sector_chain(h, ssat, sst, sid, len,
scn);
else
@@ -606,12 +553,11 @@ cdf_read_dir(const cdf_info_t *info, const cdf_header_t *h,
nd = ss / CDF_DIRECTORY_SIZE;
dir->dir_len = ns * nd;
dir->dir_tab = CAST(cdf_directory_t *,
calloc(dir->dir_len, sizeof(dir->dir_tab[0])));
dir->dir_tab = calloc(dir->dir_len, sizeof(dir->dir_tab[0]));
if (dir->dir_tab == NULL)
return -1;
if ((buf = CAST(char *, malloc(ss))) == NULL) {
if ((buf = malloc(ss)) == NULL) {
free(dir->dir_tab);
return -1;
}
@@ -630,7 +576,7 @@ cdf_read_dir(const cdf_info_t *info, const cdf_header_t *h,
cdf_unpack_dir(&dir->dir_tab[i * nd + j],
&buf[j * CDF_DIRECTORY_SIZE]);
}
sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]);
sid = CDF_TOLE4(sat->sat_tab[sid]);
}
if (NEED_SWAP)
for (i = 0; i < dir->dir_len; i++)
@@ -656,7 +602,7 @@ cdf_read_ssat(const cdf_info_t *info, const cdf_header_t *h,
if (ssat->sat_len == (size_t)-1)
return -1;
ssat->sat_tab = CAST(cdf_secid_t *, calloc(ssat->sat_len, ss));
ssat->sat_tab = calloc(ssat->sat_len, ss);
if (ssat->sat_tab == NULL)
return -1;
@@ -668,8 +614,7 @@ cdf_read_ssat(const cdf_info_t *info, const cdf_header_t *h,
}
if (i >= ssat->sat_len) {
DPRINTF(("Out of bounds reading short sector chain "
"%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i,
ssat->sat_len));
"%u > %u\n", i, ssat->sat_len));
errno = EFTYPE;
goto out;
}
@@ -678,7 +623,7 @@ cdf_read_ssat(const cdf_info_t *info, const cdf_header_t *h,
DPRINTF(("Reading short sat sector %d", sid));
goto out;
}
sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]);
sid = CDF_TOLE4(sat->sat_tab[sid]);
}
return 0;
out:
@@ -706,7 +651,7 @@ cdf_read_short_stream(const cdf_info_t *info, const cdf_header_t *h,
if (d->d_stream_first_sector < 0)
goto out;
return cdf_read_long_sector_chain(info, h, sat,
return cdf_read_long_sector_chain(info, h, sat,
d->d_stream_first_sector, d->d_size, scn);
out:
scn->sst_tab = NULL;
@@ -733,45 +678,44 @@ cdf_read_summary_info(const cdf_info_t *info, const cdf_header_t *h,
const cdf_directory_t *d;
static const char name[] = "\05SummaryInformation";
for (i = dir->dir_len; i > 0; i--)
if (dir->dir_tab[i - 1].d_type == CDF_DIR_TYPE_USER_STREAM &&
cdf_namecmp(name, dir->dir_tab[i - 1].d_name, sizeof(name))
for (i = 0; i < dir->dir_len; i++)
if (dir->dir_tab[i].d_type == CDF_DIR_TYPE_USER_STREAM &&
cdf_namecmp(name, dir->dir_tab[i].d_name, sizeof(name))
== 0)
break;
if (i == 0) {
if (i == dir->dir_len) {
DPRINTF(("Cannot find summary information section\n"));
errno = ESRCH;
errno = EFTYPE;
return -1;
}
d = &dir->dir_tab[i - 1];
d = &dir->dir_tab[i];
return cdf_read_sector_chain(info, h, sat, ssat, sst,
d->d_stream_first_sector, d->d_size, scn);
}
int
cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
uint32_t offs, cdf_property_info_t **info, size_t *count, size_t *maxcount)
cdf_read_property_info(const cdf_stream_t *sst, uint32_t offs,
cdf_property_info_t **info, size_t *count, size_t *maxcount)
{
const cdf_section_header_t *shp;
cdf_section_header_t sh;
const uint8_t *p, *q, *e;
const uint32_t *p, *q, *e;
int16_t s16;
int32_t s32;
uint32_t u32;
int64_t s64;
uint64_t u64;
cdf_timestamp_t tp;
size_t i, o, o4, nelements, j;
size_t i, o, nelements, j;
cdf_property_info_t *inp;
if (offs > UINT32_MAX / 4) {
errno = EFTYPE;
goto out;
}
shp = CAST(const cdf_section_header_t *, (const void *)
((const char *)sst->sst_tab + offs));
if (cdf_check_stream_offset(sst, h, shp, sizeof(*shp), __LINE__) == -1)
shp = (const void *)((const char *)sst->sst_tab + offs);
if (cdf_check_stream_offset(sst, shp, sizeof(*shp)) == -1)
goto out;
sh.sh_len = CDF_TOLE4(shp->sh_len);
#define CDF_SHLEN_LIMIT (UINT32_MAX / 8)
@@ -789,137 +733,105 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
if (*maxcount > CDF_PROP_LIMIT)
goto out;
*maxcount += sh.sh_properties;
inp = CAST(cdf_property_info_t *,
realloc(*info, *maxcount * sizeof(*inp)));
inp = realloc(*info, *maxcount * sizeof(*inp));
} else {
*maxcount = sh.sh_properties;
inp = CAST(cdf_property_info_t *,
malloc(*maxcount * sizeof(*inp)));
inp = malloc(*maxcount * sizeof(*inp));
}
if (inp == NULL)
goto out;
*info = inp;
inp += *count;
*count += sh.sh_properties;
p = CAST(const uint8_t *, (const void *)
((const char *)(const void *)sst->sst_tab +
offs + sizeof(sh)));
e = CAST(const uint8_t *, (const void *)
(((const char *)(const void *)shp) + sh.sh_len));
if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
p = (const void *)((const char *)sst->sst_tab + offs + sizeof(sh));
e = (const void *)(((const char *)shp) + sh.sh_len);
if (cdf_check_stream_offset(sst, e, 0) == -1)
goto out;
for (i = 0; i < sh.sh_properties; i++) {
size_t ofs = CDF_GETUINT32(p, (i << 1) + 1);
q = (const uint8_t *)(const void *)
((const char *)(const void *)p + ofs
- 2 * sizeof(uint32_t));
q = (const uint32_t *)((const char *)p +
CDF_TOLE4(p[(i << 1) + 1])) - 2;
if (q > e) {
DPRINTF(("Ran of the end %p > %p\n", q, e));
goto out;
}
inp[i].pi_id = CDF_GETUINT32(p, i << 1);
inp[i].pi_type = CDF_GETUINT32(q, 0);
DPRINTF(("%" SIZE_T_FORMAT "u) id=%x type=%x offs=0x%tx,0x%x\n",
i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
inp[i].pi_id = CDF_TOLE4(p[i << 1]);
inp[i].pi_type = CDF_TOLE4(q[0]);
DPRINTF(("%d) id=%x type=%x offs=%x\n", i, inp[i].pi_id,
inp[i].pi_type, (const char *)q - (const char *)p));
if (inp[i].pi_type & CDF_VECTOR) {
nelements = CDF_GETUINT32(q, 1);
nelements = CDF_TOLE4(q[1]);
o = 2;
} else {
nelements = 1;
o = 1;
}
o4 = o * sizeof(uint32_t);
if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
goto unknown;
switch (inp[i].pi_type & CDF_TYPEMASK) {
case CDF_NULL:
case CDF_EMPTY:
break;
case CDF_SIGNED16:
if (inp[i].pi_type & CDF_VECTOR)
goto unknown;
(void)memcpy(&s16, &q[o4], sizeof(s16));
(void)memcpy(&s16, &q[o], sizeof(s16));
inp[i].pi_s16 = CDF_TOLE2(s16);
break;
case CDF_SIGNED32:
if (inp[i].pi_type & CDF_VECTOR)
goto unknown;
(void)memcpy(&s32, &q[o4], sizeof(s32));
inp[i].pi_s32 = CDF_TOLE4((uint32_t)s32);
(void)memcpy(&s32, &q[o], sizeof(s32));
inp[i].pi_s32 = CDF_TOLE4(s32);
break;
case CDF_BOOL:
case CDF_UNSIGNED32:
if (inp[i].pi_type & CDF_VECTOR)
goto unknown;
(void)memcpy(&u32, &q[o4], sizeof(u32));
(void)memcpy(&u32, &q[o], sizeof(u32));
inp[i].pi_u32 = CDF_TOLE4(u32);
break;
case CDF_SIGNED64:
if (inp[i].pi_type & CDF_VECTOR)
goto unknown;
(void)memcpy(&s64, &q[o4], sizeof(s64));
inp[i].pi_s64 = CDF_TOLE8((uint64_t)s64);
(void)memcpy(&s64, &q[o], sizeof(s64));
inp[i].pi_s64 = CDF_TOLE4(s64);
break;
case CDF_UNSIGNED64:
if (inp[i].pi_type & CDF_VECTOR)
goto unknown;
(void)memcpy(&u64, &q[o4], sizeof(u64));
inp[i].pi_u64 = CDF_TOLE8((uint64_t)u64);
break;
case CDF_FLOAT:
if (inp[i].pi_type & CDF_VECTOR)
goto unknown;
(void)memcpy(&u32, &q[o4], sizeof(u32));
u32 = CDF_TOLE4(u32);
memcpy(&inp[i].pi_f, &u32, sizeof(inp[i].pi_f));
break;
case CDF_DOUBLE:
if (inp[i].pi_type & CDF_VECTOR)
goto unknown;
(void)memcpy(&u64, &q[o4], sizeof(u64));
u64 = CDF_TOLE8((uint64_t)u64);
memcpy(&inp[i].pi_d, &u64, sizeof(inp[i].pi_d));
(void)memcpy(&u64, &q[o], sizeof(u64));
inp[i].pi_u64 = CDF_TOLE4(u64);
break;
case CDF_LENGTH32_STRING:
case CDF_LENGTH32_WSTRING:
if (nelements > 1) {
size_t nelem = inp - *info;
if (*maxcount > CDF_PROP_LIMIT
|| nelements > CDF_PROP_LIMIT)
goto out;
*maxcount += nelements;
inp = CAST(cdf_property_info_t *,
realloc(*info, *maxcount * sizeof(*inp)));
inp = realloc(*info, *maxcount * sizeof(*inp));
if (inp == NULL)
goto out;
*info = inp;
inp = *info + nelem;
}
DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n",
nelements));
DPRINTF(("nelements = %d\n", nelements));
for (j = 0; j < nelements; j++, i++) {
uint32_t l = CDF_GETUINT32(q, o);
uint32_t l = CDF_TOLE4(q[o]);
inp[i].pi_str.s_len = l;
inp[i].pi_str.s_buf = (const char *)
(const void *)(&q[o4 + sizeof(l)]);
DPRINTF(("l = %d, r = %" SIZE_T_FORMAT
"u, s = %s\n", l,
inp[i].pi_str.s_buf = (const char *)(&q[o+1]);
DPRINTF(("l = %d, r = %d, s = %s\n", l,
CDF_ROUND(l, sizeof(l)),
inp[i].pi_str.s_buf));
if (l & 1)
l++;
o += l >> 1;
if (q + o >= e)
goto out;
o4 = o * sizeof(uint32_t);
l = 4 + CDF_ROUND(l, sizeof(l));
o += l >> 2;
}
i--;
break;
case CDF_FILETIME:
if (inp[i].pi_type & CDF_VECTOR)
goto unknown;
(void)memcpy(&tp, &q[o4], sizeof(tp));
inp[i].pi_tp = CDF_TOLE8((uint64_t)tp);
(void)memcpy(&tp, &q[o], sizeof(tp));
inp[i].pi_tp = CDF_TOLE8(tp);
break;
case CDF_CLIPBOARD:
if (inp[i].pi_type & CDF_VECTOR)
@@ -929,7 +841,7 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
unknown:
DPRINTF(("Don't know how to deal with %x\n",
inp[i].pi_type));
break;
goto out;
}
}
return 0;
@@ -939,18 +851,16 @@ out:
}
int
cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count)
cdf_unpack_summary_info(const cdf_stream_t *sst, cdf_summary_info_header_t *ssi,
cdf_property_info_t **info, size_t *count)
{
size_t i, maxcount;
const cdf_summary_info_header_t *si =
CAST(const cdf_summary_info_header_t *, sst->sst_tab);
const cdf_section_declaration_t *sd =
CAST(const cdf_section_declaration_t *, (const void *)
((const char *)sst->sst_tab + CDF_SECTION_DECLARATION_OFFSET));
const cdf_summary_info_header_t *si = sst->sst_tab;
const cdf_section_declaration_t *sd = (const void *)
((const char *)sst->sst_tab + CDF_SECTION_DECLARATION_OFFSET);
if (cdf_check_stream_offset(sst, h, si, sizeof(*si), __LINE__) == -1 ||
cdf_check_stream_offset(sst, h, sd, sizeof(*sd), __LINE__) == -1)
if (cdf_check_stream_offset(sst, si, sizeof(*si)) == -1 ||
cdf_check_stream_offset(sst, sd, sizeof(*sd)) == -1)
return -1;
ssi->si_byte_order = CDF_TOLE2(si->si_byte_order);
ssi->si_os_version = CDF_TOLE2(si->si_os_version);
@@ -967,10 +877,9 @@ cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
errno = EFTYPE;
return -1;
}
if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset),
info, count, &maxcount) == -1) {
if (cdf_read_property_info(sst, CDF_TOLE4(sd->sd_offset),
info, count, &maxcount) == -1)
return -1;
}
}
return 0;
}
@@ -1027,32 +936,32 @@ cdf_print_property_name(char *buf, size_t bufsiz, uint32_t p)
int
cdf_print_elapsed_time(char *buf, size_t bufsiz, cdf_timestamp_t ts)
{
int len = 0;
size_t len = 0;
int days, hours, mins, secs;
ts /= CDF_TIME_PREC;
secs = (int)(ts % 60);
secs = ts % 60;
ts /= 60;
mins = (int)(ts % 60);
mins = ts % 60;
ts /= 60;
hours = (int)(ts % 24);
hours = ts % 24;
ts /= 24;
days = (int)ts;
days = ts;
if (days) {
len += snprintf(buf + len, bufsiz - len, "%dd+", days);
if ((size_t)len >= bufsiz)
if (len >= bufsiz)
return len;
}
if (days || hours) {
len += snprintf(buf + len, bufsiz - len, "%.2d:", hours);
if ((size_t)len >= bufsiz)
if (len >= bufsiz)
return len;
}
len += snprintf(buf + len, bufsiz - len, "%.2d:", mins);
if ((size_t)len >= bufsiz)
if (len >= bufsiz)
return len;
len += snprintf(buf + len, bufsiz - len, "%.2d", secs);
@@ -1095,14 +1004,13 @@ cdf_dump_sat(const char *prefix, const cdf_sat_t *sat, size_t size)
size_t i, j, s = size / sizeof(cdf_secid_t);
for (i = 0; i < sat->sat_len; i++) {
(void)fprintf(stderr, "%s[%" SIZE_T_FORMAT "u]:\n%.6"
SIZE_T_FORMAT "u: ", prefix, i, i * s);
(void)fprintf(stderr, "%s[%zu]:\n%.6d: ", prefix, i, i * s);
for (j = 0; j < s; j++) {
(void)fprintf(stderr, "%5d, ",
CDF_TOLE4(sat->sat_tab[s * i + j]));
if ((j + 1) % 10 == 0)
(void)fprintf(stderr, "\n%.6" SIZE_T_FORMAT
"u: ", i * s + j + 1);
(void)fprintf(stderr, "\n%.6d: ",
i * s + j + 1);
}
(void)fprintf(stderr, "\n");
}
@@ -1121,8 +1029,7 @@ cdf_dump(void *v, size_t len)
if (j == 16) {
j = 0;
abuf[15] = '\0';
(void)fprintf(stderr, "%s\n%.4" SIZE_T_FORMAT "x: ",
abuf, i + 1);
(void)fprintf(stderr, "%s\n%.4x: ", abuf, i + 1);
}
}
(void)fprintf(stderr, "\n");
@@ -1154,8 +1061,7 @@ cdf_dump_dir(const cdf_info_t *info, const cdf_header_t *h,
d = &dir->dir_tab[i];
for (j = 0; j < sizeof(name); j++)
name[j] = (char)CDF_TOLE2(d->d_name[j]);
(void)fprintf(stderr, "Directory %" SIZE_T_FORMAT "u: %s\n",
i, name);
(void)fprintf(stderr, "Directory %zu: %s\n", i, name);
if (d->d_type < __arraycount(types))
(void)fprintf(stderr, "Type: %s\n", types[d->d_type]);
else
@@ -1166,9 +1072,9 @@ cdf_dump_dir(const cdf_info_t *info, const cdf_header_t *h,
(void)fprintf(stderr, "Right child: %d\n", d->d_right_child);
(void)fprintf(stderr, "Flags: 0x%x\n", d->d_flags);
cdf_timestamp_to_timespec(&ts, d->d_created);
(void)fprintf(stderr, "Created %s", cdf_ctime(&ts.tv_sec));
(void)fprintf(stderr, "Created %s", ctime(&ts.tv_sec));
cdf_timestamp_to_timespec(&ts, d->d_modified);
(void)fprintf(stderr, "Modified %s", cdf_ctime(&ts.tv_sec));
(void)fprintf(stderr, "Modified %s", ctime(&ts.tv_sec));
(void)fprintf(stderr, "Stream %d\n", d->d_stream_first_sector);
(void)fprintf(stderr, "Size %d\n", d->d_size);
switch (d->d_type) {
@@ -1190,7 +1096,7 @@ cdf_dump_dir(const cdf_info_t *info, const cdf_header_t *h,
default:
break;
}
}
}
@@ -1200,14 +1106,12 @@ cdf_dump_property_info(const cdf_property_info_t *info, size_t count)
cdf_timestamp_t tp;
struct timeval ts;
char buf[64];
size_t i, j;
size_t i;
for (i = 0; i < count; i++) {
cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
(void)fprintf(stderr, "%" SIZE_T_FORMAT "u) %s: ", i, buf);
(void)fprintf(stderr, "%zu) %s: ", i, buf);
switch (info[i].pi_type) {
case CDF_NULL:
break;
case CDF_SIGNED16:
(void)fprintf(stderr, "signed 16 [%hd]\n",
info[i].pi_s16);
@@ -1220,26 +1124,11 @@ cdf_dump_property_info(const cdf_property_info_t *info, size_t count)
(void)fprintf(stderr, "unsigned 32 [%u]\n",
info[i].pi_u32);
break;
case CDF_FLOAT:
(void)fprintf(stderr, "float [%g]\n",
info[i].pi_f);
break;
case CDF_DOUBLE:
(void)fprintf(stderr, "double [%g]\n",
info[i].pi_d);
break;
case CDF_LENGTH32_STRING:
(void)fprintf(stderr, "string %u [%.*s]\n",
info[i].pi_str.s_len,
info[i].pi_str.s_len, info[i].pi_str.s_buf);
break;
case CDF_LENGTH32_WSTRING:
(void)fprintf(stderr, "string %u [",
info[i].pi_str.s_len);
for (j = 0; j < info[i].pi_str.s_len - 1; j++)
(void)fputc(info[i].pi_str.s_buf[j << 1], stderr);
(void)fprintf(stderr, "]\n");
break;
case CDF_FILETIME:
tp = info[i].pi_tp;
#if defined(PHP_WIN32) && _MSC_VER <= 1500
@@ -1252,7 +1141,7 @@ cdf_dump_property_info(const cdf_property_info_t *info, size_t count)
} else {
cdf_timestamp_to_timespec(&ts, tp);
(void)fprintf(stderr, "timestamp %s",
cdf_ctime(&ts.tv_sec));
ctime(&ts.tv_sec));
}
break;
case CDF_CLIPBOARD:
@@ -1276,7 +1165,7 @@ cdf_dump_summary_info(const cdf_header_t *h, const cdf_stream_t *sst)
size_t count;
(void)&h;
if (cdf_unpack_summary_info(sst, h, &ssi, &info, &count) == -1)
if (cdf_unpack_summary_info(sst, &ssi, &info, &count) == -1)
return;
(void)fprintf(stderr, "Endian: %x\n", ssi.si_byte_order);
(void)fprintf(stderr, "Os Version %d.%d\n", ssi.si_os_version & 0xff,
@@ -1328,7 +1217,7 @@ main(int argc, char *argv[])
if (cdf_read_ssat(&info, &h, &sat, &ssat) == -1)
err(1, "Cannot read ssat");
#ifdef CDF_DEBUG
cdf_dump_sat("SSAT", &ssat, CDF_SHORT_SEC_SIZE(&h));
cdf_dump_sat("SSAT", &h, &ssat, CDF_SHORT_SEC_SIZE(&h));
#endif
if (cdf_read_dir(&info, &h, &sat, &dir) == -1)
+22 -42
View File
@@ -24,35 +24,20 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Parse Composite Document Files, the format used in Microsoft Office
* document files before they switched to zipped XML.
* Info from: http://sc.openoffice.org/compdocfileformat.pdf
*
* N.B. This is the "Composite Document File" format, and not the
* "Compound Document Format", nor the "Channel Definition Format".
* Info from: http://sc.openoffice.org/compdocfileformat.pdf
*/
#ifndef _H_CDF_
#define _H_CDF_
#ifdef PHP_WIN32
#include <winsock2.h>
#define timespec timeval
#define tv_nsec tv_usec
#endif
#ifdef __DJGPP__
#define timespec timeval
#define tv_nsec tv_usec
#endif
typedef int32_t cdf_secid_t;
#define CDF_LOOP_LIMIT 10000
#define CDF_SECID_NULL 0
#define CDF_SECID_FREE -1
#define CDF_SECID_END_OF_CHAIN -2
#define CDF_SECID_SECTOR_ALLOCATION_TABLE -3
#define CDF_SECID_END_OF_CHAIN -2
#define CDF_SECID_SECTOR_ALLOCATION_TABLE -3
#define CDF_SECID_MASTER_SECTOR_ALLOCATION_TABLE -4
typedef struct {
@@ -80,15 +65,15 @@ typedef struct {
cdf_secid_t h_master_sat[436/4];
} cdf_header_t;
#define CDF_SEC_SIZE(h) ((size_t)(1 << (h)->h_sec_size_p2))
#define CDF_SEC_SIZE(h) (1 << (h)->h_sec_size_p2)
#define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
#define CDF_SHORT_SEC_SIZE(h) ((size_t)(1 << (h)->h_short_sec_size_p2))
#define CDF_SHORT_SEC_SIZE(h) (1 << (h)->h_short_sec_size_p2)
#define CDF_SHORT_SEC_POS(h, secid) ((secid) * CDF_SHORT_SEC_SIZE(h))
typedef int32_t cdf_dirid_t;
typedef int32_t cdf_dirid_t;
#define CDF_DIRID_NULL -1
typedef int64_t cdf_timestamp_t;
typedef int64_t cdf_timestamp_t;
#define CDF_BASE_YEAR 1601
#define CDF_TIME_PREC 10000000
@@ -97,11 +82,11 @@ typedef struct {
uint16_t d_namelen;
uint8_t d_type;
#define CDF_DIR_TYPE_EMPTY 0
#define CDF_DIR_TYPE_USER_STORAGE 1
#define CDF_DIR_TYPE_USER_STREAM 2
#define CDF_DIR_TYPE_LOCKBYTES 3
#define CDF_DIR_TYPE_PROPERTY 4
#define CDF_DIR_TYPE_ROOT_STORAGE 5
#define CDF_DIR_TYPE_USER_STORAGE 1
#define CDF_DIR_TYPE_USER_STREAM 2
#define CDF_DIR_TYPE_LOCKBYTES 3
#define CDF_DIR_TYPE_PROPERTY 4
#define CDF_DIR_TYPE_ROOT_STORAGE 5
uint8_t d_color;
#define CDF_DIR_COLOR_READ 0
#define CDF_DIR_COLOR_BLACK 1
@@ -110,8 +95,8 @@ typedef struct {
cdf_dirid_t d_storage;
uint64_t d_storage_uuid[2];
uint32_t d_flags;
cdf_timestamp_t d_created;
cdf_timestamp_t d_modified;
cdf_timestamp_t d_created;
cdf_timestamp_t d_modified;
cdf_secid_t d_stream_first_sector;
uint32_t d_size;
uint32_t d_unused0;
@@ -173,9 +158,7 @@ typedef struct {
int32_t _pi_s32;
uint64_t _pi_u64;
int64_t _pi_s64;
cdf_timestamp_t _pi_tp;
float _pi_f;
double _pi_d;
cdf_timestamp_t _pi_tp;
struct {
uint32_t s_len;
const char *s_buf;
@@ -187,8 +170,6 @@ typedef struct {
#define pi_s32 pi_val._pi_s32
#define pi_u16 pi_val._pi_u16
#define pi_s16 pi_val._pi_s16
#define pi_f pi_val._pi_f
#define pi_d pi_val._pi_d
#define pi_tp pi_val._pi_tp
#define pi_str pi_val._pi_str
} cdf_property_info_t;
@@ -197,13 +178,13 @@ typedef struct {
/* Variant type definitions */
#define CDF_EMPTY 0x00000000
#define CDF_NULL 0x00000001
#define CDF_NULL 0x00000001
#define CDF_SIGNED16 0x00000002
#define CDF_SIGNED32 0x00000003
#define CDF_FLOAT 0x00000004
#define CDF_DOUBLE 0x00000005
#define CDF_CY 0x00000006
#define CDF_DATE 0x00000007
#define CDF_DATE 0x00000007
#define CDF_BSTR 0x00000008
#define CDF_DISPATCH 0x00000009
#define CDF_ERROR 0x0000000a
@@ -214,7 +195,7 @@ typedef struct {
#define CDF_SIGNED8 0x00000010
#define CDF_UNSIGNED8 0x00000011
#define CDF_UNSIGNED16 0x00000012
#define CDF_UNSIGNED32 0x00000013
#define CDF_UNSIGNED32 0x00000013
#define CDF_SIGNED64 0x00000014
#define CDF_UNSIGNED64 0x00000015
#define CDF_INT 0x00000016
@@ -249,7 +230,7 @@ typedef struct {
#define CDF_PROPERTY_SUBJECT 0x00000003
#define CDF_PROPERTY_AUTHOR 0x00000004
#define CDF_PROPERTY_KEYWORDS 0x00000005
#define CDF_PROPERTY_COMMENTS 0x00000006
#define CDF_PROPERTY_COMMENTS 0x00000006
#define CDF_PROPERTY_TEMPLATE 0x00000007
#define CDF_PROPERTY_LAST_SAVED_BY 0x00000008
#define CDF_PROPERTY_REVISION_NUMBER 0x00000009
@@ -299,20 +280,19 @@ int cdf_read_ssat(const cdf_info_t *, const cdf_header_t *, const cdf_sat_t *,
cdf_sat_t *);
int cdf_read_short_stream(const cdf_info_t *, const cdf_header_t *,
const cdf_sat_t *, const cdf_dir_t *, cdf_stream_t *);
int cdf_read_property_info(const cdf_stream_t *, const cdf_header_t *, uint32_t,
int cdf_read_property_info(const cdf_stream_t *, uint32_t,
cdf_property_info_t **, size_t *, size_t *);
int cdf_read_summary_info(const cdf_info_t *, const cdf_header_t *,
const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *,
const cdf_dir_t *, cdf_stream_t *);
int cdf_unpack_summary_info(const cdf_stream_t *, const cdf_header_t *,
cdf_summary_info_header_t *, cdf_property_info_t **, size_t *);
int cdf_unpack_summary_info(const cdf_stream_t *, cdf_summary_info_header_t *,
cdf_property_info_t **, size_t *);
int cdf_print_classid(char *, size_t, const cdf_classid_t *);
int cdf_print_property_name(char *, size_t, uint32_t);
int cdf_print_elapsed_time(char *, size_t, cdf_timestamp_t);
uint16_t cdf_tole2(uint16_t);
uint32_t cdf_tole4(uint32_t);
uint64_t cdf_tole8(uint64_t);
char *cdf_ctime(const time_t *);
#ifdef CDF_DEBUG
void cdf_dump_header(const cdf_header_t *);
+9 -24
View File
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: cdf_time.c,v 1.11 2011/12/13 13:48:41 christos Exp $")
FILE_RCSID("@(#)$File: cdf_time.c,v 1.6 2009/03/10 11:44:29 christos Exp $")
#endif
#include <time.h>
@@ -108,22 +108,22 @@ cdf_timestamp_to_timespec(struct timeval *ts, cdf_timestamp_t t)
ts->tv_usec = (t % CDF_TIME_PREC) * CDF_TIME_PREC;
t /= CDF_TIME_PREC;
tm.tm_sec = (int)(t % 60);
tm.tm_sec = t % 60;
t /= 60;
tm.tm_min = (int)(t % 60);
tm.tm_min = t % 60;
t /= 60;
tm.tm_hour = (int)(t % 24);
tm.tm_hour = t % 24;
t /= 24;
/* XXX: Approx */
tm.tm_year = (int)(CDF_BASE_YEAR + (t / 365));
tm.tm_year = CDF_BASE_YEAR + (t / 365);
rdays = cdf_getdays(tm.tm_year);
t -= rdays - 1;
tm.tm_mday = cdf_getday(tm.tm_year, (int)t);
tm.tm_mon = cdf_getmonth(tm.tm_year, (int)t);
t -= rdays;
tm.tm_mday = cdf_getday(tm.tm_year, t);
tm.tm_mon = cdf_getmonth(tm.tm_year, t);
tm.tm_wday = 0;
tm.tm_yday = 0;
tm.tm_isdst = 0;
@@ -143,13 +143,10 @@ cdf_timestamp_to_timespec(struct timeval *ts, cdf_timestamp_t t)
}
int
/*ARGSUSED*/
cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timeval *ts)
{
#ifndef __lint__
(void)&t;
(void)&ts;
#endif
#ifdef notyet
struct tm tm;
if (gmtime_r(&ts->ts_sec, &tm) == NULL) {
@@ -165,18 +162,6 @@ cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timeval *ts)
return 0;
}
char *
cdf_ctime(const time_t *sec)
{
static char ctbuf[26];
char *ptr = ctime(sec);
if (ptr != NULL)
return ptr;
(void)snprintf(ctbuf, sizeof(ctbuf), "*Bad* 0x%16.16llx\n",
(long long)*sec);
return ctbuf;
}
#ifdef TEST
int
@@ -188,7 +173,7 @@ main(int argc, char *argv[])
char *p, *q;
cdf_timestamp_to_timespec(&ts, tst);
p = cdf_ctime(&ts.tv_sec);
p = ctime(&ts.tv_sec);
if ((q = strchr(p, '\n')) != NULL)
*q = '\0';
if (strcmp(ref, p) != 0)
+16 -21
View File
@@ -36,7 +36,7 @@
#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: compress.c,v 1.68 2011/12/08 12:38:24 rrt Exp $")
FILE_RCSID("@(#)$File: compress.c,v 1.63 2009/03/23 14:21:51 christos Exp $")
#endif
#include "magic.h"
@@ -84,7 +84,6 @@ private const struct {
{ "BZh", 3, { "bzip2", "-cd", NULL }, 1 }, /* bzip2-ed */
{ "LZIP", 4, { "lzip", "-cdq", NULL }, 1 },
{ "\3757zXZ\0",6,{ "xz", "-cd", NULL }, 1 }, /* XZ Utils */
{ "LRZI", 4, { "lrzip", "-dqo-", NULL }, 1 }, /* LRZIP */
};
#define NODATA ((size_t)~0)
@@ -147,13 +146,14 @@ error:
return rv;
}
#endif
/*
* `safe' write for sockets and pipes.
*/
private ssize_t
swrite(int fd, const void *buf, size_t n)
{
ssize_t rv;
int rv;
size_t rn = n;
do
@@ -164,7 +164,7 @@ swrite(int fd, const void *buf, size_t n)
return -1;
default:
n -= rv;
buf = CAST(const char *, buf) + rv;
buf = ((const char *)buf) + rv;
break;
}
while (n > 0);
@@ -178,7 +178,7 @@ swrite(int fd, const void *buf, size_t n)
protected ssize_t
sread(int fd, void *buf, size_t n, int canbepipe)
{
ssize_t rv;
int rv;
#ifdef FIONREAD
int t = 0;
#endif
@@ -224,7 +224,7 @@ sread(int fd, void *buf, size_t n, int canbepipe)
nocheck:
do
switch ((rv = FINFO_READ_FUNC(fd, buf, n))) {
switch ((rv = read(fd, buf, n))) {
case -1:
if (errno == EINTR)
continue;
@@ -245,11 +245,7 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf,
size_t nbytes)
{
char buf[4096];
ssize_t r;
int tfd;
#ifdef HAVE_MKSTEMP
int te;
#endif
int r, tfd;
(void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf);
#ifndef HAVE_MKSTEMP
@@ -262,9 +258,9 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf,
}
#else
tfd = mkstemp(buf);
te = errno;
r = errno;
(void)unlink(buf);
errno = te;
errno = r;
#endif
if (tfd == -1) {
file_error(ms, errno,
@@ -301,7 +297,7 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf,
return -1;
}
(void)close(tfd);
if (FINFO_LSEEK_FUNC(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -316,6 +312,7 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf,
#define FNAME (1 << 3)
#define FCOMMENT (1 << 4)
private size_t
uncompressgzipped(struct magic_set *ms, const unsigned char *old,
unsigned char **newch, size_t n)
@@ -350,14 +347,13 @@ uncompressgzipped(struct magic_set *ms, const unsigned char *old,
/* XXX: const castaway, via strchr */
z.next_in = (Bytef *)strchr((const char *)old + data_start,
old[data_start]);
z.avail_in = CAST(uint32_t, (n - data_start));
z.avail_in = n - data_start;
z.next_out = *newch;
z.avail_out = HOWMANY;
z.zalloc = Z_NULL;
z.zfree = Z_NULL;
z.opaque = Z_NULL;
/* LINTED bug in header macro */
rc = inflateInit2(&z, -15);
if (rc != Z_OK) {
file_error(ms, 0, "zlib: %s", z.msg);
@@ -385,8 +381,7 @@ uncompressbuf(struct magic_set *ms, int fd, size_t method,
const unsigned char *old, unsigned char **newch, size_t n)
{
int fdin[2], fdout[2];
ssize_t r;
pid_t pid;
int r;
#ifdef BUILTIN_DECOMPRESS
/* FIXME: This doesn't cope with bzip2 */
@@ -400,12 +395,12 @@ uncompressbuf(struct magic_set *ms, int fd, size_t method,
file_error(ms, errno, "cannot create pipe");
return NODATA;
}
switch (pid = fork()) {
switch (fork()) {
case 0: /* child */
(void) close(0);
if (fd != -1) {
(void) dup(fd);
(void) FINFO_LSEEK_FUNC(0, (off_t)0, SEEK_SET);
(void) lseek(0, (off_t)0, SEEK_SET);
} else {
(void) dup(fdin[0]);
(void) close(fdin[0]);
@@ -491,7 +486,7 @@ err:
(void) close(fdin[1]);
(void) close(fdout[0]);
#ifdef WNOHANG
while (waitpid(pid, NULL, WNOHANG) != -1)
while (waitpid(-1, NULL, WNOHANG) != -1)
continue;
#else
(void)wait(NULL);
Loaded 100 of 459 files, more files were not shown because too many files have changed in this diff. Show more