iliaa Fri Jan 2 20:43:41 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/phar phar.c Log: Fixed a possible crash when phar_create_signature() fails http://cvs.php.net/viewvc.cgi/php-src/ext/phar/phar.c?r1=1.370.2.55&r2=1.370.2.56&diff_format=u Index: php-src/ext/phar/phar.c diff -u php-src/ext/phar/phar.c:1.370.2.55 php-src/ext/phar/phar.c:1.370.2.56 --- php-src/ext/phar/phar.c:1.370.2.55 Wed Dec 31 11:15:42 2008 +++ php-src/ext/phar/phar.c Fri Jan 2 20:43:41 2009 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar.c,v 1.370.2.55 2008/12/31 11:15:42 sebastian Exp $ */ +/* $Id: phar.c,v 1.370.2.56 2009/01/02 20:43:41 iliaa Exp $ */ #define PHAR_MAIN 1 #include "phar_internal.h" @@ -3122,7 +3122,7 @@ return EOF; #endif default: { - char *digest; + char *digest = NULL; int digest_len; if (FAILURE == phar_create_signature(phar, newfile, &digest, &digest_len, error TSRMLS_CC)) { @@ -3131,7 +3131,9 @@ spprintf(error, 0, "phar error: unable to write signature: %s", save); efree(save); } - efree(digest); + if (digest) { + efree(digest); + } if (closeoldfile) { php_stream_close(oldfile); } @@ -3624,7 +3626,7 @@ php_info_print_table_header(2, "Phar: PHP Archive support", "enabled"); php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION); php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION); - php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.55 $"); + php_info_print_table_row(2, "CVS revision", "$Revision: 1.370.2.56 $"); php_info_print_table_row(2, "Phar-based phar archives", "enabled"); php_info_print_table_row(2, "Tar-based phar archives", "enabled"); php_info_print_table_row(2, "ZIP-based phar archives", "enabled");
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php