1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2026-05-09 08:05:27 +00:00

Fix a subscript error that accessed uninitialized data.

* localtime.c (tzload): The number of entries in 'types'
is timecnt, not typecnt.
* NEWS: Mention this.
Problem reported by Jörg Richter in:
http://mm.icann.org/pipermail/tz/2014-September/021561.html
This commit is contained in:
Paul Eggert
2014-09-06 07:18:21 -07:00
parent 488e7a8ed5
commit dff28f195b
2 changed files with 7 additions and 2 deletions

5
NEWS
View File

@@ -7,6 +7,11 @@ Unreleased, experimental changes
Shanks says Asia/Novokuznetsk switched from LMT (not "NMT") on 1924-05-01,
not 1920-01-06. The old entry was based on a misinterpretation of Shanks.
Changes affecting code
An access to uninitalized data has been fixed.
(Thanks to Jörg Richter for reporting the problem.)
Release 2014g - 2014-08-28 12:31:23 -0700

View File

@@ -571,10 +571,10 @@ tzload(register const char *name, register struct state *const sp,
** If type 0 is is unused in transitions,
** it's the type to use for early times.
*/
for (i = 0; i < sp->typecnt; ++i)
for (i = 0; i < sp->timecnt; ++i)
if (sp->types[i] == 0)
break;
i = (i >= sp->typecnt) ? 0 : -1;
i = i < sp->timecnt ? -1 : 0;
/*
** Absent the above,
** if there are transition times