Commit f02212ea authored by Kevin Daudt's avatar Kevin Daudt 💻

main/musl: backport tzdata fixes

parent cc9f3aaf
Pipeline #59101 passed with stages
in 2 minutes and 13 seconds
......@@ -2,7 +2,7 @@
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=musl
pkgver=1.1.24
pkgrel=9
pkgrel=10
pkgdesc="the musl c library (libc) implementation"
url="https://musl.libc.org/"
arch="all"
......@@ -37,6 +37,9 @@ source="https://musl.libc.org/releases/musl-$pkgver.tar.gz
0003-cut-down-size-of-some-libc-struct-members.patch
0004-restore-lock-skipping-for-processes-that-return-to-s.patch
avoid-out-of-bounds-read-for-invalid-quoted-timezone.patch
fix-parsing-offsets-after-long-timezone-names.patch
ldconfig
__stack_chk_fail_local.c
getconf.c
......@@ -195,6 +198,8 @@ dd46ef77b71d34b6207611be59dd4555b4e53fd7169732b9e5ee9a66f1e8da69fcca6634f895b9d3
c6cd692359961c382b7382c6eb819bf93ca8d687b7bd71e4d992acabc7003bd8388b22898059b6ac5abdf08c07020c8cbd2a5f908802258418079e096cdbc058 0002-don-t-use-libc.threads_minus_1-as-relaxed-atomic-for.patch
416aa17d4211ebbca97b4ce47eea8d8375ac5e0b602a4806175bc172be21b8291ac08fdaf39203e3a083a067bbbfa999cfb875f739d5fa07871885ac02eba75a 0003-cut-down-size-of-some-libc-struct-members.patch
f0e5ab79a793152c5e6c1c560b409ef062c8f9232c893b36c58b9667e5e0e86969555d8e2e9e17b59835ec7ed3c926a6ccce453824561ad82e47364c44374549 0004-restore-lock-skipping-for-processes-that-return-to-s.patch
976cc0049984879c46e7cd3671faa21087d42358ef828c5502d867dde29080a5e5bd725ff07b36f11992fd1af9cfc4e0dd8436947d96095dfbd84d6167fa3d97 avoid-out-of-bounds-read-for-invalid-quoted-timezone.patch
6b976cc9a5e3b6bafaa4fb96365c2784777271c9e22ca29a695906baaa884f2c5ba5833cab17ca7d4dd8139240bc7fdbe8fd16172a1ef4fa8d3134760f9c251e fix-parsing-offsets-after-long-timezone-names.patch
8d3a2d5315fc56fee7da9abb8b89bb38c6046c33d154c10d168fb35bfde6b0cf9f13042a3bceee34daf091bc409d699223735dcf19f382eeee1f6be34154f26f ldconfig
062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c
0d80f37b34a35e3d14b012257c50862dfeb9d2c81139ea2dfa101d981d093b009b9fa450ba27a708ac59377a48626971dfc58e20a3799084a65777a0c32cbc7d getconf.c
......
From 8e452abae67db445fb6c3e37cd566c4788c2e8f3 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 22 Feb 2020 16:01:12 -0600
Subject: avoid out-of-bounds read for invalid quoted timezone
Parsing the timezone name must stop when reaching the null terminator.
In that case, there is no '>' to skip.
---
src/time/__tz.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/time/__tz.c b/src/time/__tz.c
index 185642e8..a962960e 100644
--- a/src/time/__tz.c
+++ b/src/time/__tz.c
@@ -86,9 +86,9 @@ static void getname(char *d, const char **p)
int i;
if (**p == '<') {
++*p;
- for (i=0; (*p)[i]!='>' && i<TZNAME_MAX; i++)
+ for (i=0; (*p)[i] && (*p)[i]!='>' && i<TZNAME_MAX; i++)
d[i] = (*p)[i];
- ++*p;
+ if ((*p)[i]) ++*p;
} else {
for (i=0; ((*p)[i]|32)-'a'<26U && i<TZNAME_MAX; i++)
d[i] = (*p)[i];
--
cgit v1.2.1
From 33338ebc853d37c80f0f236cc7a92cb0acc6aace Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 22 Feb 2020 16:01:13 -0600
Subject: fix parsing offsets after long timezone names
TZ containg a timezone name with >TZNAME_MAX characters currently
breaks musl's timezone parsing. getname() stops after TZNAME_MAX
characters. getoff() will consume no characters (because the next
character is not a digit) and incorrectly return 0. Then, because
there are remaining alphabetic characters, __daylight == 1, and
dst_off == -3600.
getname() must consume the entire timezone name, even if it will not
fit in d/__tzname, so when it returns, s points to the offset digits.
---
src/time/__tz.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/time/__tz.c b/src/time/__tz.c
index a962960e..49a7371e 100644
--- a/src/time/__tz.c
+++ b/src/time/__tz.c
@@ -86,15 +86,15 @@ static void getname(char *d, const char **p)
int i;
if (**p == '<') {
++*p;
- for (i=0; (*p)[i] && (*p)[i]!='>' && i<TZNAME_MAX; i++)
- d[i] = (*p)[i];
+ for (i=0; (*p)[i] && (*p)[i]!='>'; i++)
+ if (i<TZNAME_MAX) d[i] = (*p)[i];
if ((*p)[i]) ++*p;
} else {
- for (i=0; ((*p)[i]|32)-'a'<26U && i<TZNAME_MAX; i++)
- d[i] = (*p)[i];
+ for (i=0; ((*p)[i]|32)-'a'<26U; i++)
+ if (i<TZNAME_MAX) d[i] = (*p)[i];
}
*p += i;
- d[i] = 0;
+ d[i<TZNAME_MAX?i:TZNAME_MAX] = 0;
}
#define VEC(...) ((const unsigned char[]){__VA_ARGS__})
--
cgit v1.2.1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment