From commits-return-2717-apmail-stdcxx-commits-archive=stdcxx.apache.org@stdcxx.apache.org Thu Apr 10 12:39:21 2008 Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 30380 invoked from network); 10 Apr 2008 12:39:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Apr 2008 12:39:21 -0000 Received: (qmail 21276 invoked by uid 500); 10 Apr 2008 12:39:22 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 21260 invoked by uid 500); 10 Apr 2008 12:39:22 -0000 Mailing-List: contact commits-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list commits@stdcxx.apache.org Received: (qmail 21251 invoked by uid 99); 10 Apr 2008 12:39:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Apr 2008 05:39:22 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Apr 2008 12:38:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AB2071A9832; Thu, 10 Apr 2008 05:38:58 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r646779 - /stdcxx/trunk/tests/src/locale.cpp Date: Thu, 10 Apr 2008 12:38:56 -0000 To: commits@stdcxx.apache.org From: faridz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080410123858.AB2071A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: faridz Date: Thu Apr 10 05:38:45 2008 New Revision: 646779 URL: http://svn.apache.org/viewvc?rev=646779&view=rev Log: 2008-04-10 Farid Zaripov * tests/src/locale.cpp (_rw_all_locales): Don't link nodes into result when size == 0 to prevent heap corruption in _rw_reset_locales(). Modified: stdcxx/trunk/tests/src/locale.cpp Modified: stdcxx/trunk/tests/src/locale.cpp URL: http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/locale.cpp?rev=646779&r1=646778&r2=646779&view=diff ============================================================================== --- stdcxx/trunk/tests/src/locale.cpp (original) +++ stdcxx/trunk/tests/src/locale.cpp Thu Apr 10 05:38:45 2008 @@ -1276,7 +1276,7 @@ // // eliminate locales that are duplicates according to // canonical name. we do this because the setlocale() - // doesn't seem to tell us about aliases. + // doesn't seem to tell us about aliases. // bool duplicate = false; @@ -1308,8 +1308,12 @@ remove (fname); // link all of the nodes into result - result.entries = entries; - result.count = size; + if (size) { + result.entries = entries; + result.count = size; + } + else + _QUIET_FREE (entries); } // link each node to the next. if the array is sorted,