xlocale: Fix potential segfault
authorJohn Marino <draco@marino.st>
Sat, 11 Jul 2015 09:52:54 +0000 (11:52 +0200)
committerJohn Marino <draco@marino.st>
Sat, 11 Jul 2015 13:09:29 +0000 (15:09 +0200)
commitbf0d950af810c072318374249db960bc2121a540
tree274f6e63100859f2808a78dff80548f4164eec7b
parent36211fc612d412f6cd1fb69dd094f2fa9c0b6e6c
xlocale: Fix potential segfault

It was possible for locale and rune locale to become out of sync causing
mb* and similar functions to be called with the wrong data, including
with a null pointer.  Unfortunately, this still does not solve the
gfortran testsuite failure related to newlocale usage.

Taken-from: FreeBSD SVN 264038 (2 APR 2014)
lib/libc/locale/setrunelocale.c
lib/libc/locale/xlocale.c