[libcxx] Error out if __libcpp_mbsrtowcs_l fails in __time_get_storage
authorMartin Storsjö <martin@martin.st>
Mon, 28 Oct 2019 21:46:34 +0000 (23:46 +0200)
committerMartin Storsjö <martin@martin.st>
Tue, 3 Nov 2020 15:15:05 +0000 (17:15 +0200)
commit1127ef789c02e735357c9c9f2ffaf6291dc8e6d7
tree37eec0e09b70e4baca520592e5179dce44464edf
parent8a73aa8c4c3ee82e7d650c6a957937713a4a9ab4
[libcxx] Error out if __libcpp_mbsrtowcs_l fails in __time_get_storage

If __libcpp_mbsrtowcs_l outputs zero wchar_t's for week days or
month names (due to errors in the locale function setup), these are
matched all the time in __time_get_storage::__analyze, ending up in
an infinite loop, allocating more memory until killed.

Differential Revision: https://reviews.llvm.org/D69553
libcxx/src/locale.cpp