Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43386 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36770 invoked from network); 18 Mar 2009 07:50:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2009 07:50:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:33741] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/32-41920-DC7A0C94 for ; Wed, 18 Mar 2009 02:50:37 -0500 Received: from ws.home ([10.1.10.3]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 18 Mar 2009 09:52:04 +0200 Message-ID: <49C0A7C7.8000804@zend.com> Date: Wed, 18 Mar 2009 10:50:31 +0300 User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Matt Wilmas CC: internals@lists.php.net, Lukas Kahwe Smith , =?ISO-8859-1?Q?Johannes_Schl=FCter?= References: <1113CE12226949C2939A31971420991F@pc1> In-Reply-To: <1113CE12226949C2939A31971420991F@pc1> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 18 Mar 2009 07:52:04.0735 (UTC) FILETIME=[6DE7D0F0:01C9A79E] Subject: Re: [PATCH] Bug #45877: LONG_MAX/MIN array key as string/int From: dmitry@zend.com (Dmitry Stogov) BTW may be we should eliminate strtol() at all. There's no need to scan the string twice. Dmitry. Matt Wilmas wrote: > Hi all, > > Assuming there are no objections, I'll commit this fix in a few hours... > > Besides the bug report(s), I had also found awhile ago that currently an > array key can be LONG_MAX or LONG_MIN as a string and/or integer because > of a check in ZEND_HANDLE_NUMERIC() (I assume to avoid a slow errno > check for ERANGE originally). I changed it to use the *same method* > that's used in the scanner, is_numeric_string(), etc., and those 2 > values are now treated as an integer. > > It's just a few lines changed in zend_hash.h, although I had to move > some of the definitions from zend_operators.h to zend.h (is that OK?). > > Patches (didn't check HEAD's yet): > http://realplain.com/php/array_key_limit.diff > http://realplain.com/php/array_key_limit_5_3.diff > > > - Matt