1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-20 17:09:34 +00:00

zdump: don't use uninitialized storage

* zdump.c (main): Avoid use of uninitalized locals in rare cases.
* NEWS: Mention this.
This commit is contained in:
Paul Eggert
2014-08-23 18:10:54 -07:00
parent d0aac72175
commit ab1034cab1
2 changed files with 5 additions and 3 deletions

4
NEWS
View File

@ -41,8 +41,8 @@ Unreleased, experimental changes
Changes affecting code
Some crashes have been fixed when the tz library is given a
compiled time zone file containing invalid or outlandish data.
Some crashes have been fixed when zdump or the tz library is given
invalid or outlandish input.
The tz library no longer mishandles leap seconds on platforms with
unsigned time_t in time zones that lack ordinary transitions after 1970.

View File

@ -420,8 +420,11 @@ _("%s: usage: %s [--version] [--help] [-{vV}] [-{ct} [lo,]hi] zonename ...\n"
int
main(int argc, char *argv[])
{
/* These are static so that they're initially zero. */
static char * abbrev;
static size_t abbrevsize;
static struct tm newtm;
register int i;
register bool vflag;
register bool Vflag;
@ -433,7 +436,6 @@ main(int argc, char *argv[])
time_t t;
time_t newt;
struct tm tm;
struct tm newtm;
register struct tm * tmp;
register struct tm * newtmp;