]> granicus.if.org Git - php/commitdiff
fix build on windows, fix segfault in tsrm by uninitialized pointer
authorGreg Beaver <cellog@php.net>
Fri, 14 Dec 2007 04:08:34 +0000 (04:08 +0000)
committerGreg Beaver <cellog@php.net>
Fri, 14 Dec 2007 04:08:34 +0000 (04:08 +0000)
ext/phar/Makefile.frag
ext/phar/phar.phar
ext/phar/phar_object.c

index 3e79356fa1457f960fba9bdedcb39bfc6b6b8ab3..f30ccfb80bc1757005897b2c822f7a2e5764e89e 100755 (executable)
@@ -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
 
index 1ca18e93597e9f3326f115c57cbe418816de8044..4a543b2e14eeddd731ea9823f7232348788b35da 100755 (executable)
Binary files a/ext/phar/phar.phar and b/ext/phar/phar.phar differ
index 4ac637dcf7ce4dd2f910bada943438e7b29c33fb..233ca3f7c17dda4051ec25265173b590ea9363ca 100755 (executable)
@@ -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);