com php-src: Fixed bug #68901 (use after free): NEWS ext/phar/phar_object.c
| From: | Xinchen Hui | Date: | Wed, 28 Jan 2015 16:00:09 +0000 |
| Subject: | com php-src: Fixed bug #68901 (use after free): NEWS ext/phar/phar_object.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84415@lists.php.net to get a copy of this message | ||
Commit: b2cf3f064b8f5efef89bb084521b61318c71781b
Author: Xinchen Hui <laruence@php.net> Thu, 29 Jan 2015 00:00:09 +0800
Parents: 4c5995b1729b100b00707ddf32d072355dcc3ae8
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b2cf3f064b8f5efef89bb084521b61318c71781b
Log:
Fixed bug #68901 (use after free)
Bugs:
https://bugs.php.net/68901
Changed paths:
M NEWS
M ext/phar/phar_object.c
Diff:
diff --git a/NEWS b/NEWS
index 145660f..f08e4f4 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,9 @@ PHP NEWS
. Fixed bug #68750 (PDOMysql with mysqlnd does not allow the usage of
named pipes). (steffenb198@aol.com)
+- Phar:
+ . Fixed bug #68901 (use after free). (bugreports at internot dot info)
+
- Sqlite3:
. Fixed bug #68260 (SQLite3Result::fetchArray declares wrong
required_num_args). (Julien)
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 3671054..712795b 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -2139,8 +2139,8 @@ static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool
c
}
its_ok:
if (SUCCESS == php_stream_stat_path(newpath, &ssb)) {
- efree(oldpath);
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "phar \"%s\"
exists and must be unlinked prior to conversion", newpath);
+ efree(oldpath);
return NULL;
}
if (!phar->is_data) {