From: Greg Beaver Date: Fri, 14 Dec 2007 04:08:34 +0000 (+0000) Subject: fix build on windows, fix segfault in tsrm by uninitialized pointer X-Git-Tag: RELEASE_2_0_0a1~1182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63f3d5958dc82bbce66b2746c8f2f12359a09adf;p=php fix build on windows, fix segfault in tsrm by uninitialized pointer --- diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag index 3e79356fa1..f30ccfb80b 100755 --- a/ext/phar/Makefile.frag +++ b/ext/phar/Makefile.frag @@ -20,6 +20,6 @@ $(builddir)/phar.phar: $(builddir)/phar.php $(srcdir)/phar/*.inc $(srcdir)/phar/ export PHP="$(top_builddir)/$(SAPI_CLI_PATH)"; \ export BANG="$(INSTALL_ROOT)$(bindir)/$(program_prefix)php$(program_suffix)$(EXEEXT)"; \ fi; \ - $$PHP -d phar.readonly=0 $(srcdir)/phar.php pack -f $(builddir)/phar.phar -a pharcommand -c auto -x CVS -p 0 -s $(srcdir)/phar/phar.php -h sha1 -b "$$BANG" $(srcdir)/phar/ + $$PHP -d phar.readonly=0 $(srcdir)/phar.php pack -f $(builddir)/phar.phar -a pharcommand -c bz2 -x CVS -p 0 -s $(srcdir)/phar/phar.php -h sha1 -b "$$BANG" $(srcdir)/phar/ @chmod +x $(builddir)/phar.phar diff --git a/ext/phar/phar.phar b/ext/phar/phar.phar index 1ca18e9359..4a543b2e14 100755 Binary files a/ext/phar/phar.phar and b/ext/phar/phar.phar differ diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 4ac637dcf7..233ca3f7c1 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -339,7 +339,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) case IS_STRING : break; case IS_OBJECT : - if (instanceof_function(Z_OBJCE_PP(value), spl_ce_SplFileInfo)) { + if (instanceof_function(Z_OBJCE_PP(value), spl_ce_SplFileInfo TSRMLS_CC)) { char *test; zval dummy; spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(*value TSRMLS_CC); @@ -357,6 +357,7 @@ static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) efree(fname); return ZEND_HASH_APPLY_KEEP; } + test = NULL; test = expand_filepath(fname, test TSRMLS_CC); if (test) { efree(fname); @@ -512,7 +513,7 @@ PHP_METHOD(Phar, buildFromIterator) pass.l = base_len; pass.ret = return_value; - if (SUCCESS == spl_iterator_apply(obj, (spl_iterator_apply_func_t) phar_build, (void *) &pass)) { + if (SUCCESS == spl_iterator_apply(obj, (spl_iterator_apply_func_t) phar_build, (void *) &pass TSRMLS_CC)) { phar_flush(phar_obj->arc.archive, 0, 0, &error TSRMLS_CC); if (error) { zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, error);