[libcxx] r177694 - Fix buffer read overflow in money_get::do_get(). Found by UBSan

Marshall Clow mclow at qualcomm.com
Thu Mar 21 19:14:40 PDT 2013


Author: marshall
Date: Thu Mar 21 21:14:40 2013
New Revision: 177694

URL: http://llvm.org/viewvc/llvm-project?rev=177694&view=rev
Log:
Fix buffer read overflow in money_get::do_get(). Found by UBSan

Modified:
    libcxx/trunk/include/locale

Modified: libcxx/trunk/include/locale
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/locale?rev=177694&r1=177693&r2=177694&view=diff
==============================================================================
--- libcxx/trunk/include/locale (original)
+++ libcxx/trunk/include/locale Thu Mar 21 21:14:40 2013
@@ -3359,7 +3359,7 @@ money_get<_CharT, _InputIterator>::do_ge
         if (__neg)
             *__nc++ = '-';
         for (const char_type* __w = __wb.get(); __w < __wn; ++__w, ++__nc)
-            *__nc = __src[find(__atoms, __atoms+sizeof(__atoms), *__w) - __atoms];
+            *__nc = __src[find(__atoms, _VSTD::end(__atoms), *__w) - __atoms];
         *__nc = char();
         if (sscanf(__nbuf, "%Lf", &__v) != 1)
             __throw_runtime_error("money_get error");





More information about the cfe-commits mailing list