mailing list of musl libc
 help / color / mirror / code / Atom feed
* musl 1.1.10 uselocale regression, patch
@ 2015-06-05 16:26 Rich Felker
  2015-06-06 15:44 ` Anthony G. Basile
  0 siblings, 1 reply; 4+ messages in thread
From: Rich Felker @ 2015-06-05 16:26 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 105 bytes --]

A new regression in uselocale made it into musl 1.1.10. All users
should apply the attached patch.

Rich

[-- Attachment #2: musl-1.1.10-uselocale-0-fix.diff --]
[-- Type: text/plain, Size: 827 bytes --]

From 63f4b9f18f3674124d8bcb119739fec85e6da005 Mon Sep 17 00:00:00 2001
From: Timo Teräs <timo.teras@iki.fi>
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-06 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-05 16:26 musl 1.1.10 uselocale regression, patch Rich Felker
2015-06-06 15:44 ` Anthony G. Basile
2015-06-06 16:31   ` Rich Felker
2015-06-06 18:06     ` Anthony G. Basile

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).