stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r646779 - /stdcxx/trunk/tests/src/locale.cpp
Date Thu, 10 Apr 2008 12:38:56 GMT
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 <farid_zaripov@epam.com>

	* 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,



Mime
View raw message