Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80568 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28819 invoked from network); 15 Jan 2015 16:41:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2015 16:41:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.175 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 74.125.82.175 mail-we0-f175.google.com Received: from [74.125.82.175] ([74.125.82.175:64014] helo=mail-we0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/05-14306-0BDE7B45 for ; Thu, 15 Jan 2015 11:41:21 -0500 Received: by mail-we0-f175.google.com with SMTP id k11so15749286wes.6 for ; Thu, 15 Jan 2015 08:41:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=ztKExXMFg7AzLpE3xFAnm1Q8sSX1C4PEmatPjeJqhAw=; b=WkGTPdwgyam3U167piu2a6aycz//D8mZoCWbKkm4brKIntKaMioxCynWzE6f+3s826 F852UamTFtQ2sIFhz8DwzCkpfzluTpEWGreX/vVYF9uqO6BS1SpsffSFwuJwg1mMEpHS L4fOIVZmBFxGT4aFUhX35Nk0AfH2G1OCJ+nb0EiyHhw3iV1omX8+hn/EzXsHX5iEhbXr hzL+6CnIHHH/UZE64GvYBgZrZPrqa88m5VnTvGb5Z8cZ33xi1Tr2UtfZ3hAwWMJgfq81 nkAgWR37V7/9VCTf83aecltVEf1r/xvhMRVQobmlwI1mqnJi53kC5Gma1zNFYii9SE2F Ikkw== X-Received: by 10.180.82.98 with SMTP id h2mr20797765wiy.7.1421340078189; Thu, 15 Jan 2015 08:41:18 -0800 (PST) Received: from [192.168.2.121] (89-104-28-113.customer.bnet.at. [89.104.28.113]) by mx.google.com with ESMTPSA id dv9sm8123216wib.14.2015.01.15.08.41.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jan 2015 08:41:17 -0800 (PST) Sender: Michael Wallner Message-ID: <54B7EDAC.3060005@php.net> Date: Thu, 15 Jan 2015 17:41:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <1421339511-9078-1-git-send-email-git@internot.info> In-Reply-To: <1421339511-9078-1-git-send-email-git@internot.info> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] Fixed bug #68839 Possible null pointer dereference From: mike@php.net (Michael Wallner) On 15/01/15 17:31, Joshua Rogers wrote: > --- > ext/phar/zip.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/ext/phar/zip.c b/ext/phar/zip.c > index 2a95580..2117b0e 100644 > --- a/ext/phar/zip.c > +++ b/ext/phar/zip.c > @@ -1217,7 +1217,9 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int > if (!phar->is_temporary_alias && phar->alias_len) { > entry.fp = php_stream_fopen_tmpfile(); > if (entry.fp == NULL) { > - spprintf(error, 0, "phar error: unable to create temporary file"); > + if (error) { > + spprintf(error, 0, "phar error: unable to create temporary file"); > + } > return EOF; > } > if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) { > @@ -1309,7 +1311,9 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int > len = pos - user_stub + 18; > entry.fp = php_stream_fopen_tmpfile(); > if (entry.fp == NULL) { > - spprintf(error, 0, "phar error: unable to create temporary file"); > + if (error) { > + spprintf(error, 0, "phar error: unable to create temporary file"); > + } > return EOF; > } > entry.uncompressed_filesize = len + 5; > @@ -1346,7 +1350,9 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int > /* Either this is a brand new phar (add the stub), or the default stub is required (overwrite the stub) */ > entry.fp = php_stream_fopen_tmpfile(); > if (entry.fp == NULL) { > - spprintf(error, 0, "phar error: unable to create temporary file"); > + if (error) { > + spprintf(error, 0, "phar error: unable to create temporary file"); > + } > return EOF; > } > if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) { > Looks good. -- Regards, Mike