Print this page
5366 strcoll_l may destroy its arguments, then crash

@@ -37,15 +37,13 @@
 
 size_t
 mbstowcs_l(wchar_t *_RESTRICT_KYWD pwcs, const char *_RESTRICT_KYWD s,
     size_t n, locale_t loc)
 {
-        static const mbstate_t initial = { 0 };
-        mbstate_t mbs;
+        mbstate_t mbs = { 0 };
         const char *sp;
 
-        mbs = initial;
         sp = s;
         return (loc->ctype->lc_mbsnrtowcs(pwcs, &sp, ULONG_MAX, n, &mbs));
 }
 
 size_t