You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

36 lines
1.5 KiB

From d144590d38fa321b46b8e199c754006318985c84 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev <stas@php.net>
Date: Sun, 12 Jun 2016 16:43:12 -0700
Subject: [PATCH] Fix bug #72321 - use efree() for emalloc allocation
---
ext/phar/phar_object.c | 4 ++--
ext/phar/tests/72321_1.zip | Bin 0 -> 250 bytes
ext/phar/tests/72321_2.zip | Bin 0 -> 258 bytes
ext/phar/tests/bug72321.phpt | 26 ++++++++++++++++++++++++++
4 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 ext/phar/tests/72321_1.zip
create mode 100644 ext/phar/tests/72321_2.zip
create mode 100644 ext/phar/tests/bug72321.phpt
Index: php5-5.4.45/ext/phar/phar_object.c
===================================================================
--- php5-5.4.45.orig/ext/phar/phar_object.c 2016-08-27 23:19:15.000000000 +0200
+++ php5-5.4.45/ext/phar/phar_object.c 2016-08-27 23:19:15.000000000 +0200
@@ -4298,14 +4298,14 @@
if (!php_stream_mkdir(fullpath, entry->flags & PHAR_ENT_PERM_MASK, PHP_STREAM_MKDIR_RECURSIVE, NULL)) {
spprintf(error, 4096, "Cannot extract \"%s\", could not create directory \"%s\"", entry->filename, fullpath);
efree(fullpath);
- free(new_state.cwd);
+ efree(new_state.cwd);
return FAILURE;
}
} else {
if (!php_stream_mkdir(fullpath, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL)) {
spprintf(error, 4096, "Cannot extract \"%s\", could not create directory \"%s\"", entry->filename, fullpath);
efree(fullpath);
- free(new_state.cwd);
+ efree(new_state.cwd);
return FAILURE;
}
}