mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 20:22:00 +00:00
Bug 819825, fix ICE/STUN crash on Android by null-checking setlocale(), r=abr
This commit is contained in:
parent
1f48f84d13
commit
48a25bac31
@ -91,9 +91,11 @@ mbslen(const char *s, size_t *ncharsp)
|
||||
if (!strstr(my_locale, "UTF-8"))
|
||||
ABORT(R_NOT_FOUND);
|
||||
#else
|
||||
/* can't count UTF-8 characters with mbrlen if the locale isn't UTF-8 */
|
||||
if (! strcasestr(setlocale(LC_CTYPE, 0), "UTF-8"))
|
||||
ABORT(R_NOT_FOUND);
|
||||
/* can't count UTF-8 characters with mbrlen if the locale isn't UTF-8 */
|
||||
/* null-checking setlocale is required because Android */
|
||||
char *locale = setlocale(LC_CTYPE, 0);
|
||||
if (!locale || !strcasestr(locale, "UTF-8"))
|
||||
ABORT(R_NOT_FOUND);
|
||||
#endif
|
||||
|
||||
#ifdef DARWIN
|
||||
|
Loading…
x
Reference in New Issue
Block a user