Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25195 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92930 invoked by uid 1010); 4 Aug 2006 08:58:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 92914 invoked from network); 4 Aug 2006 08:58:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2006 08:58:47 -0000 X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.142.136.132 msa2-mx.centurytel.net Linux 2.4/2.6 Received: from ([209.142.136.132:55315] helo=msa2-mx.centurytel.net) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 8C/82-63329-24C03D44 for ; Fri, 04 Aug 2006 04:58:45 -0400 Received: from pc1 (64-91-13-158.dyn.centurytel.net [64.91.13.158]) by msa2-mx.centurytel.net (8.13.6/8.13.6) with SMTP id k748wcsZ015677 for ; Fri, 4 Aug 2006 03:58:39 -0500 Message-ID: <008901c6b7a4$2dca9ad0$0201a8c0@pc1> To: Date: Fri, 4 Aug 2006 03:58:39 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Subject: [PATCH] MAX_LENGTH_OF_LONG, and possible buffer overflows From: php_lists@realplain.com ("Matt W") Hi there, OK, so overflows aren't very likely with MAX_LENGTH_OF_LONG set to 20, but I found 3 places I think you'll want to change. :-) Also, can MAX_LENGTH_OF_LONG be changed to be accurate on 32-bit platforms? Is setting it to (sizeof(long) > 4 ? 20 : 11) acceptable? If MAX_LENGTH_OF_LONG is truely accurate, I can use it to optimize is_numeric_[string|unicode]() (and zend_u_strtod() too I think if it's not otherwise rewritten), and it saves a few bytes of memory on 32-bit systems. ;-) http://realplain.com/php/MAX_LENGTH_OF_LONG.diff http://realplain.com/php/MAX_LENGTH_OF_LONG_5_2.diff Thanks, Matt