This patchest fixes some bugs in localtime.c when TZif files specify a
UT offset equal to -2**31.  Such an offset overflows when negated on a
32-bit platform, and this leads to undefined behavior – typically
wraparound arithmetic, but the C standard says anything can happen.

The patchset also changes zic.c to reject attempts to create such an
offset, adjusts some nearby code to be a bit cleaner and more
portable.

Paul Eggert (5):
  Omit unnecessary L suffixes
  zic no longer generates utoff == -2**31
  Make sure 2**31 - 1 is signed
  Port TWOS_COMPLEMENT to signed-magnitude hosts
  Disallow UT offsets equal to -2**31

 NEWS        |  4 ++++
 localtime.c | 48 ++++++++++++++++++++++++++++++++----------------
 private.h   |  7 +++++--
 strftime.c  |  5 +++--
 zic.c       |  7 ++++---
 5 files changed, 48 insertions(+), 23 deletions(-)

--
2.51.0

Reply via email to