[PHP-CVS] cvs: php-src /ext/phar func_interceptors.c
kalle Wed May 13 15:54:49 2009 UTC Modified files: /php-src/ext/phar func_interceptors.c Log: Nuke compiler warning http://cvs.php.net/viewvc.cgi/php-src/ext/phar/func_interceptors.c?r1=1.30&r2=1.31&diff_format=u Index: php-src/ext/phar/func_interceptors.c diff -u php-src/ext/phar/func_interceptors.c:1.30 php-src/ext/phar/func_interceptors.c:1.31 --- php-src/ext/phar/func_interceptors.c:1.30 Wed Dec 31 11:12:35 2008 +++ php-src/ext/phar/func_interceptors.cWed May 13 15:54:48 2009 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: func_interceptors.c,v 1.30 2008/12/31 11:12:35 sebastian Exp $ */ +/* $Id: func_interceptors.c,v 1.31 2009/05/13 15:54:48 kalle Exp $ */ #include "phar_internal.h" @@ -98,7 +98,7 @@ char *contents; zend_bool use_include_path = 0; php_stream *stream; - int len, newlen; + int len; long offset = -1; long maxlen = PHP_STREAM_COPY_ALL; zval *zcontext = NULL; @@ -205,6 +205,7 @@ if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) { #if PHP_MAJOR_VERSION < 6 if (PG(magic_quotes_runtime)) { + int newlen; contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */ len = newlen; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/phar func_interceptors.c
cellog Fri Sep 26 04:54:23 2008 UTC Modified files: /php-src/ext/phar func_interceptors.c Log: MFB: fix another memory leak http://cvs.php.net/viewvc.cgi/php-src/ext/phar/func_interceptors.c?r1=1.28&r2=1.29&diff_format=u Index: php-src/ext/phar/func_interceptors.c diff -u php-src/ext/phar/func_interceptors.c:1.28 php-src/ext/phar/func_interceptors.c:1.29 --- php-src/ext/phar/func_interceptors.c:1.28 Fri Sep 26 04:41:40 2008 +++ php-src/ext/phar/func_interceptors.cFri Sep 26 04:54:22 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: func_interceptors.c,v 1.28 2008/09/26 04:41:40 cellog Exp $ */ +/* $Id: func_interceptors.c,v 1.29 2008/09/26 04:54:22 cellog Exp $ */ #include "phar_internal.h" @@ -686,6 +686,7 @@ int save_len; notfound: + efree(entry); save = PHAR_G(cwd); save_len = PHAR_G(cwd_len); /* this file is not in the current directory, use the original path */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/phar func_interceptors.c
cellog Fri Sep 26 04:41:41 2008 UTC Modified files: /php-src/ext/phar func_interceptors.c Log: MFB: fix obvious memory leak http://cvs.php.net/viewvc.cgi/php-src/ext/phar/func_interceptors.c?r1=1.27&r2=1.28&diff_format=u Index: php-src/ext/phar/func_interceptors.c diff -u php-src/ext/phar/func_interceptors.c:1.27 php-src/ext/phar/func_interceptors.c:1.28 --- php-src/ext/phar/func_interceptors.c:1.27 Sat Sep 13 22:31:18 2008 +++ php-src/ext/phar/func_interceptors.cFri Sep 26 04:41:40 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: func_interceptors.c,v 1.27 2008/09/13 22:31:18 cellog Exp $ */ +/* $Id: func_interceptors.c,v 1.28 2008/09/26 04:41:40 cellog Exp $ */ #include "phar_internal.h" @@ -645,6 +645,7 @@ /* fopen within phar, if :// is not in the url, then prepend phar:/// */ entry_len = (int) filename_length; if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL TSRMLS_CC)) { + efree(entry); efree(arch); goto skip_phar; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/phar func_interceptors.c func_interceptors.h phar.c
dmitry Thu Aug 14 13:02:13 2008 UTC Modified files: /php-src/ext/phar func_interceptors.c func_interceptors.h phar.c Log: Fixed bug #45613 Segfault when using is_file() on Apache-2.2.8 http://cvs.php.net/viewvc.cgi/php-src/ext/phar/func_interceptors.c?r1=1.24&r2=1.25&diff_format=u Index: php-src/ext/phar/func_interceptors.c diff -u php-src/ext/phar/func_interceptors.c:1.24 php-src/ext/phar/func_interceptors.c:1.25 --- php-src/ext/phar/func_interceptors.c:1.24 Tue Aug 12 15:37:36 2008 +++ php-src/ext/phar/func_interceptors.cThu Aug 14 13:02:13 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: func_interceptors.c,v 1.24 2008/08/12 15:37:36 helly Exp $ */ +/* $Id: func_interceptors.c,v 1.25 2008/08/14 13:02:13 dmitry Exp $ */ #include "phar_internal.h" @@ -1130,6 +1130,85 @@ } /* }}} */ +static struct _phar_orig_functions { + void(*orig_fopen)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_file_get_contents)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_is_file)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_is_link)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_is_dir)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_opendir)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_file_exists)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_fileperms)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_fileinode)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_filesize)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_fileowner)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_filegroup)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_fileatime)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_filemtime)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_filectime)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_filetype)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_is_writable)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_is_readable)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_is_executable)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_lstat)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_readfile)(INTERNAL_FUNCTION_PARAMETERS); + void(*orig_stat)(INTERNAL_FUNCTION_PARAMETERS); +} phar_orig_functions = {NULL}; + +void phar_save_orig_functions(TSRMLS_D) /* {{{ */ +{ + phar_orig_functions.orig_fopen = PHAR_G(orig_fopen); + phar_orig_functions.orig_file_get_contents = PHAR_G(orig_file_get_contents); + phar_orig_functions.orig_is_file = PHAR_G(orig_is_file); + phar_orig_functions.orig_is_link = PHAR_G(orig_is_link); + phar_orig_functions.orig_is_dir= PHAR_G(orig_is_dir); + phar_orig_functions.orig_opendir = PHAR_G(orig_opendir); + phar_orig_functions.orig_file_exists = PHAR_G(orig_file_exists); + phar_orig_functions.orig_fileperms = PHAR_G(orig_fileperms); + phar_orig_functions.orig_fileinode = PHAR_G(orig_fileinode); + phar_orig_functions.orig_filesize = PHAR_G(orig_filesize); + phar_orig_functions.orig_fileowner = PHAR_G(orig_fileowner); + phar_orig_functions.orig_filegroup = PHAR_G(orig_filegroup); + phar_orig_functions.orig_fileatime = PHAR_G(orig_fileatime); + phar_orig_functions.orig_filemtime = PHAR_G(orig_filemtime); + phar_orig_functions.orig_filectime = PHAR_G(orig_filectime); + phar_orig_functions.orig_filetype = PHAR_G(orig_filetype); + phar_orig_functions.orig_is_writable = PHAR_G(orig_is_writable); + phar_orig_functions.orig_is_readable = PHAR_G(orig_is_readable); + phar_orig_functions.orig_is_executable = PHAR_G(orig_is_executable); + phar_orig_functions.orig_lstat = PHAR_G(orig_lstat); + phar_orig_functions.orig_readfile = PHAR_G(orig_readfile); + phar_orig_functions.orig_stat = PHAR_G(orig_stat); +} +/* }}} */ + +void phar_restore_orig_functions(TSRMLS_D) /* {{{ */ +{ + PHAR_G(orig_fopen) = phar_orig_functions.orig_fopen; + PHAR_G(orig_file_get_contents) = phar_orig_functions.orig_file_get_contents; + PHAR_G(orig_is_file) = phar_orig_functions.orig_is_file; + PHAR_G(orig_is_link) = phar_orig_functions.orig_is_link; + PHAR_G(orig_is_dir)= phar_orig_functions.orig_is_dir; + PHAR_G(orig_opendir) = phar_orig_functions.orig_opendir; + PHAR_G(orig_file_exists) = phar_orig_functions.orig_file_exists; + PHAR_G(orig_fileperms) = phar_orig_functions.orig_fileperms; + PHAR_G(orig_fileinode) = phar_orig_functions.orig
Re: [PHP-CVS] cvs: php-src /ext/phar func_interceptors.c
What exactly was merged to fix/change/what? HEAD has the log now with just 'MFB'..wtf? Please, follow the rules.. --Jani Marcus Boerger [EMAIL PROTECTED] kirjoitti: helly Tue Aug 12 15:37:36 2008 UTC Modified files: /php-src/ext/phar func_interceptors.c Log: - MFB http://cvs.php.net/viewvc.cgi/php-src/ext/phar/func_interceptors.c?r1=1.23&r2=1.24&diff_format=u Index: php-src/ext/phar/func_interceptors.c diff -u php-src/ext/phar/func_interceptors.c:1.23 php-src/ext/phar/func_interceptors.c:1.24 --- php-src/ext/phar/func_interceptors.c:1.23 Fri Aug 1 13:45:05 2008 +++ php-src/ext/phar/func_interceptors.cTue Aug 12 15:37:36 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: func_interceptors.c,v 1.23 2008/08/01 13:45:05 sfox Exp $ */ +/* $Id: func_interceptors.c,v 1.24 2008/08/12 15:37:36 helly Exp $ */ #include "phar_internal.h" @@ -950,7 +950,9 @@ } } } - efree(entry); + if (entry != filename) { + efree(entry); + } efree(arch); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/phar func_interceptors.c
helly Tue Aug 12 15:37:36 2008 UTC Modified files: /php-src/ext/phar func_interceptors.c Log: - MFB http://cvs.php.net/viewvc.cgi/php-src/ext/phar/func_interceptors.c?r1=1.23&r2=1.24&diff_format=u Index: php-src/ext/phar/func_interceptors.c diff -u php-src/ext/phar/func_interceptors.c:1.23 php-src/ext/phar/func_interceptors.c:1.24 --- php-src/ext/phar/func_interceptors.c:1.23 Fri Aug 1 13:45:05 2008 +++ php-src/ext/phar/func_interceptors.cTue Aug 12 15:37:36 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: func_interceptors.c,v 1.23 2008/08/01 13:45:05 sfox Exp $ */ +/* $Id: func_interceptors.c,v 1.24 2008/08/12 15:37:36 helly Exp $ */ #include "phar_internal.h" @@ -950,7 +950,9 @@ } } } - efree(entry); + if (entry != filename) { + efree(entry); + } efree(arch); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php