Return-Path: Delivered-To: apmail-incubator-stdcxx-commits-archive@www.apache.org Received: (qmail 55446 invoked from network); 22 Feb 2006 02:44:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Feb 2006 02:44:57 -0000 Received: (qmail 52568 invoked by uid 500); 22 Feb 2006 02:44:57 -0000 Delivered-To: apmail-incubator-stdcxx-commits-archive@incubator.apache.org Received: (qmail 52555 invoked by uid 500); 22 Feb 2006 02:44:57 -0000 Mailing-List: contact stdcxx-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-commits@incubator.apache.org Received: (qmail 52543 invoked by uid 500); 22 Feb 2006 02:44:57 -0000 Delivered-To: apmail-incubator-stdcxx-cvs@incubator.apache.org Received: (qmail 52540 invoked by uid 99); 22 Feb 2006 02:44:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Feb 2006 18:44:57 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 21 Feb 2006 18:44:56 -0800 Received: (qmail 55164 invoked by uid 65534); 22 Feb 2006 02:44:36 -0000 Message-ID: <20060222024436.55129.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r379657 - /incubator/stdcxx/trunk/tests/src/printf.cpp Date: Wed, 22 Feb 2006 02:44:35 -0000 To: stdcxx-cvs@incubator.apache.org From: sebor@apache.org X-Mailer: svnmailer-1.0.6 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sebor Date: Tue Feb 21 18:44:31 2006 New Revision: 379657 URL: http://svn.apache.org/viewcvs?rev=379657&view=rev Log: 2006-02-21 Martin Sebor * printf.cpp (rw_vasnprintf): Increased the size of the backtrack array, increased the size of the cvtspec buffer after a successful allocation, and asserted preconditions. Modified: incubator/stdcxx/trunk/tests/src/printf.cpp Modified: incubator/stdcxx/trunk/tests/src/printf.cpp URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/tests/src/printf.cpp?rev=379657&r1=379656&r2=379657&view=diff ============================================================================== --- incubator/stdcxx/trunk/tests/src/printf.cpp (original) +++ incubator/stdcxx/trunk/tests/src/printf.cpp Tue Feb 21 18:44:31 2006 @@ -837,7 +837,7 @@ FmtSpec *pspec = specbuf; // local buffer for backtrack offsets implementing conditionals - int backtrack [32]; + int backtrack [64]; int nextoff = 0; size_t default_bufsize = 1024; @@ -891,6 +891,8 @@ } else goto fail; + + spec_bufsize *= 2; } if ('{' == *fc) { @@ -955,6 +957,7 @@ RW_ASSERT (0 < nextoff); RW_ASSERT (0 == len); + RW_ASSERT (offinx < sizeof backtrack / sizeof *backtrack); if (pspec [paramno].cond_true) { // change from an inactive if to an active else @@ -999,6 +1002,7 @@ if (!pspec [paramno].cond_true) { // the end of an inactive clause + RW_ASSERT (offinx < sizeof backtrack / sizeof *backtrack); RW_ASSERT (backtrack [offinx] <= int (buflen)); // set the length so as to backtrack to the position