Blame SOURCES/php-5.5.21-CVE-2015-2301.patch

8bac60
From 920a0afbf8f83962c70aaf9a144810f320be92b3 Mon Sep 17 00:00:00 2001
8bac60
From: Xinchen Hui <laruence@php.net>
8bac60
Date: Thu, 29 Jan 2015 00:00:09 +0800
8bac60
Subject: [PATCH] Fixed bug #68901 (use after free)
8bac60
8bac60
---
8bac60
 NEWS                   | 3 +++
8bac60
 ext/phar/phar_object.c | 2 +-
8bac60
 2 files changed, 4 insertions(+), 1 deletion(-)
8bac60
8bac60
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
8bac60
index a021200..add1fa0 100644
8bac60
--- a/ext/phar/phar_object.c
8bac60
+++ b/ext/phar/phar_object.c
8bac60
@@ -2139,8 +2139,8 @@ static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool c
8bac60
 	}
8bac60
 its_ok:
8bac60
 	if (SUCCESS == php_stream_stat_path(newpath, &ssb)) {
8bac60
-		efree(oldpath);
8bac60
 		zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "phar \"%s\" exists and must be unlinked prior to conversion", newpath);
8bac60
+		efree(oldpath);
8bac60
 		return NULL;
8bac60
 	}
8bac60
 	if (!phar->is_data) {