[PATCH] Fix wcsmbs with invalid charsets
Jakub Jelinek
jakub@redhat.com
Thu Sep 5 13:20:00 GMT 2002
Hi!
When either malloc fails or there is no gconv module for the given charset,
we end up with endless loop.
This got broken when I was changing the patch to not test locale
name against _nl_C_name (in that case was failed: in that if and the rest
of code in else branch and so both would unlock/exit the function).
Sorry.
2002-09-05 Jakub Jelinek <jakub@redhat.com>
* wcsmbs/wcsmbsload.c (__wcsmbs_load_conv): Unlock and return in
case of failure.
--- libc/wcsmbs/wcsmbsload.c.jj 2002-09-03 15:30:40.000000000 +0200
+++ libc/wcsmbs/wcsmbsload.c 2002-09-05 22:12:51.000000000 +0200
@@ -169,6 +169,8 @@ __wcsmbs_load_conv (struct locale_data *
{
failed:
new_category->private.ctype = &__wcsmbs_gconv_fcts_c;
+ __libc_lock_unlock (__libc_setlocale_lock);
+ return;
}
/* Get name of charset of the locale. */
Jakub
More information about the Libc-hacker
mailing list