Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81213 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34480 invoked from network); 27 Jan 2015 09:42:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jan 2015 09:42:20 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:57649] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/43-18778-B7D57C45 for ; Tue, 27 Jan 2015 04:42:20 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id 25E6A10C856; Tue, 27 Jan 2015 09:42:16 +0000 (GMT) Date: Tue, 27 Jan 2015 09:42:15 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Joshua Rogers cc: internals@lists.php.net In-Reply-To: <54BD5998.4050806@internot.info> Message-ID: References: <1421694958-14772-1-git-send-email-git@internot.info> <54BD5998.4050806@internot.info> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] [PATCH] Fix potential int overflow in date extension. From: derick@php.net (Derick Rethans) On Tue, 20 Jan 2015, Joshua Rogers wrote: > On 20/01/15 06:15, Joshua Rogers wrote: > > -- > > ext/date/lib/tm2unixtime.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > Somebody please take a look at /ext/date/lib/parse_tz.c too: > > 438timelib_sll timelib_get_current_offset(timelib_time *t) > [..] > 446 return (t->z + t->dst) * -60; > Should that be cast timelib_sll too? > > I think perhaps the function should be an int, seeing as it looks like > the result should be negative. Somebody please check. The result can be either positive or negative as t->z can be both. timelib_sll seems right though, as it stands for "long long signed". I don't quite see how this can overflow though - as t->z and t->dst come just close to 100000 (and it's internal provided data). cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine