mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: musl 1.1.10 uselocale regression, patch
Date: Fri, 5 Jun 2015 12:26:26 -0400	[thread overview]
Message-ID: <20150605162626.GA20452@brightrain.aerifal.cx> (raw)

[-- 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

             reply	other threads:[~2015-06-05 16:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 16:26 Rich Felker [this message]
2015-06-06 15:44 ` Anthony G. Basile
2015-06-06 16:31   ` Rich Felker
2015-06-06 18:06     ` Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150605162626.GA20452@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).