cross

cross-compilation toolchain using musl libc
git clone git://z3bra.org/cross
Log | Files | Refs | README

musl-1.1.10-musl.diff (1592B)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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
From e8cbe0bad4284906230a53af4c91ad2b9713d03b Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Wed, 08 Jul 2015 02:46:45 +0000
Subject: fix negated return value of ns_skiprr, breakage in related functions

due to a reversed pointer difference computation, ns_skiprr always
returned a negative value, which functions using it would interpret as
an error.

patch by Yu Lu.
---
diff --git a/src/network/ns_parse.c b/src/network/ns_parse.c
index 3ff33a8..d01da47 100644
--- a/src/network/ns_parse.c
+++ b/src/network/ns_parse.c
@@ -95,7 +95,7 @@ int ns_skiprr(const unsigned char *ptr, const unsigned char *eom, ns_sect sectio
 			p += r;
 		}
 	}
-	return ptr - p;
+	return p - ptr;
 bad:
 	errno = EMSGSIZE;
 	return -1;
--
cgit v0.9.0.3-65-g4555