summaryrefslogtreecommitdiffstats
path: root/bug71354.patch
blob: 7cbafc59dd6b65315d9cf5c5e9eb04e3a7924a37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Backported from 5.5 for 5.4 by Remi Collet
binary patch dropped

From 13ad4d3e971807f9a58ab5933182907dc2958539 Mon Sep 17 00:00:00 2001
From: Stanislav Malyshev <stas@php.net>
Date: Wed, 13 Jan 2016 16:32:29 -0800
Subject: [PATCH] Fix bug #71354 - remove UMR when size is 0

---
 ext/phar/phar_object.c       |   1 +
 ext/phar/tests/bug71354.phpt |  13 +++++++++++++
 ext/phar/tests/bug71354.tar  | Bin 0 -> 1536 bytes
 3 files changed, 14 insertions(+)
 create mode 100644 ext/phar/tests/bug71354.phpt
 create mode 100644 ext/phar/tests/bug71354.tar

diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 6d25509..e21a982 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -4977,6 +4977,7 @@ PHP_METHOD(PharFileInfo, getContent)
 
 	phar_seek_efp(link, 0, SEEK_SET, 0, 0 TSRMLS_CC);
 	Z_TYPE_P(return_value) = IS_STRING;
+	Z_STRVAL_P(return_value) = NULL;
 	Z_STRLEN_P(return_value) = php_stream_copy_to_mem(fp, &(Z_STRVAL_P(return_value)), link->uncompressed_filesize, 0);
 
 	if (!Z_STRVAL_P(return_value)) {