6c82cf3dec
Upstream commit: 2fe2af88abd13ae5636881da2e26f461ecb7dfb5 - i386: Remove broken CAN_USE_REGISTER_ASM_EBP (bug 28771) - Update syscall lists for Linux 5.15 - powerpc: Fix unrecognized instruction errors with recent GCC - timezone: test-case for BZ #28707 - timezone: handle truncated timezones from tzcode-2021d and later (BZ #28707) - Fix subscript error with odd TZif file [BZ #28338] - AArch64: Check for SVE in ifuncs [BZ #28744] - intl/plural.y: Avoid conflicting declarations of yyerror and yylex - Linux: Fix 32-bit vDSO for clock_gettime on powerpc32 - linux: Add sparck brk implementation - Update sparc libm-test-ulps - Update hppa libm-test-ulps - riscv: align stack before calling _dl_init [BZ #28703] - riscv: align stack in clone [BZ #28702] - powerpc64[le]: Allocate extra stack frame on syscall.S - elf: Fix tst-cpu-features-cpuinfo for KVM guests on some AMD systems [BZ #28704] - nss: Use "files dns" as the default for the hosts database (bug 28700) - arm: Guard ucontext _rtld_global_ro access by SHARED, not PIC macro - mips: increase stack alignment in clone to match the ABI - mips: align stack in clone [BZ #28223]
28 lines
1.0 KiB
Diff
28 lines
1.0 KiB
Diff
commit 515a6f53cd984d5e6e374fbee52772f967fc3c73
|
|
Author: Paul Eggert <eggert@cs.ucla.edu>
|
|
Date: Mon Sep 13 22:49:45 2021 -0700
|
|
|
|
Fix subscript error with odd TZif file [BZ #28338]
|
|
|
|
* time/tzfile.c (__tzfile_compute): Fix unlikely off-by-one bug
|
|
that accessed before start of an array when an oddball-but-valid
|
|
TZif file was queried with an unusual time_t value.
|
|
|
|
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
(cherry picked from commit 645277434a42efc547d2cac8bfede4da10b4049f)
|
|
|
|
diff --git a/time/tzfile.c b/time/tzfile.c
|
|
index 4377018a55936389..190a777152b31cee 100644
|
|
--- a/time/tzfile.c
|
|
+++ b/time/tzfile.c
|
|
@@ -765,8 +765,7 @@ __tzfile_compute (__time64_t timer, int use_localtime,
|
|
*leap_correct = leaps[i].change;
|
|
|
|
if (timer == leaps[i].transition /* Exactly at the transition time. */
|
|
- && ((i == 0 && leaps[i].change > 0)
|
|
- || leaps[i].change > leaps[i - 1].change))
|
|
+ && (leaps[i].change > (i == 0 ? 0 : leaps[i - 1].change)))
|
|
{
|
|
*leap_hit = 1;
|
|
while (i > 0
|