Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66610 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2704 invoked from network); 14 Mar 2013 11:42:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Mar 2013 11:42:33 -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:56312] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BE/70-29153-7A7B1415 for ; Thu, 14 Mar 2013 06:42:33 -0500 Received: from localhost (localhost [IPv6:::1]) by xdebug.org (Postfix) with ESMTPS id CE23B10D5D7; Thu, 14 Mar 2013 11:42:25 +0000 (GMT) Date: Thu, 14 Mar 2013 11:42:25 +0000 (GMT) X-X-Sender: derick@whisky.home.derickrethans.nl To: Anatol Belski cc: Gustavo Lopes , PHP Developers Mailing List In-Reply-To: <1363165566.3221.79.camel@ghost> Message-ID: References: <1362869409.3221.77.camel@ghost> <00824f21b8abd44ee577bdde7df711d4.squirrel@webmail.klapt.com> <1363165566.3221.79.camel@ghost> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] Fix for bug #63437 From: derick@php.net (Derick Rethans) On Wed, 13 Mar 2013, Anatol Belski wrote: > On Mon, 2013-03-11 at 11:42 +0000, Derick Rethans wrote: > > > > On Mon, 11 Mar 2013, Anatol Belski wrote: > > > > > > What is the way you had in the mind to achieve the > > > string<->integer conversions? > > > > atoll() (or atoq()). > > Please take a look at the reworked patch in #53437 > > https://bugs.php.net/patch-display.php?bug_id=53437&patch=date_patch_var3.patch&revision=latest > > Serializing 64 bit integers as strings. That bit looks ok, I have a few comments though: + PHP_DATE_INTERVAL_READ_PROPERTY("special_type", special.type, unsigned int); + if ((*intobj)->diff->special.amount > 12 || (*intobj)->diff->special.amount < -12) { + php_error(E_ERROR, "Invalid serialization data for DateInterval object (special_amount)"); + } Checking for the values here, means that the library (timelib) isn't in control of the values that are allowed anymore. I wonder whether the deserialisation should bother checking some of those special/extra types/values. The only important thing is to not have things crash really. And secondly, where are the test cases? 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