From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28104 invoked by alias); 5 Sep 2002 20:20:55 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 28087 invoked from network); 5 Sep 2002 20:20:54 -0000 Received: from unknown (HELO sunsite.mff.cuni.cz) (195.113.19.66) by sources.redhat.com with SMTP; 5 Sep 2002 20:20:54 -0000 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.11.6/8.11.6) id g85KKo116542; Thu, 5 Sep 2002 22:20:50 +0200 Date: Thu, 05 Sep 2002 13:20:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath Cc: Glibc hackers Subject: [PATCH] Fix wcsmbs with invalid charsets Message-ID: <20020905222050.V1013@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2002-09/txt/msg00007.txt.bz2 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 * 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