From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7881 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: musl 1.1.10 uselocale regression, patch Date: Fri, 5 Jun 2015 12:26:26 -0400 Message-ID: <20150605162626.GA20452@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="SUOF0GtieIMvvwua" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1433521625 13799 80.91.229.3 (5 Jun 2015 16:27:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jun 2015 16:27:05 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7894-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jun 05 18:27:04 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Z0uSG-00052u-0i for gllmg-musl@m.gmane.org; Fri, 05 Jun 2015 18:26:48 +0200 Original-Received: (qmail 7337 invoked by uid 550); 5 Jun 2015 16:26:46 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7263 invoked from network); 5 Jun 2015 16:26:40 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7881 Archived-At: --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline A new regression in uselocale made it into musl 1.1.10. All users should apply the attached patch. Rich --SUOF0GtieIMvvwua Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="musl-1.1.10-uselocale-0-fix.diff" Content-Transfer-Encoding: 8bit >From 63f4b9f18f3674124d8bcb119739fec85e6da005 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Fri, 05 Jun 2015 07:39:42 +0000 Subject: fix uselocale((locale_t)0) not to modify locale commit 68630b55c0c7219fe9df70dc28ffbf9efc8021d8 made the new locale to be assigned unconditonally resulting in crashes later on. --- diff --git a/src/locale/uselocale.c b/src/locale/uselocale.c index b70a0c1..0fc5ecb 100644 --- a/src/locale/uselocale.c +++ b/src/locale/uselocale.c @@ -8,9 +8,7 @@ locale_t __uselocale(locale_t new) locale_t old = self->locale; locale_t global = &libc.global_locale; - if (new == LC_GLOBAL_LOCALE) new = global; - - self->locale = new; + if (new) self->locale = new == LC_GLOBAL_LOCALE ? global : new; return old == global ? LC_GLOBAL_LOCALE : old; } -- cgit v0.9.0.3-65-g4555 --SUOF0GtieIMvvwua--