[tz] [PATCH] Revert fix for "stack buffer overrun", which was a false alarm.

Paul Eggert eggert at CS.UCLA.EDU
Sun Jun 15 17:33:17 UTC 2014


* localtime.c (time1): Shrink size of 'types' local back down
from TZ_MAX_TIMES to TZ_MAX_TYPES.  The smaller value suffices,
since nseen can grow to at most TZ_MAX_TYPES.  (Thanks to
Arthur David Olson.)
* NEWS: Remove mention of non-fix.
---
 NEWS        | 2 --
 localtime.c | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 442f8c9..848adf7 100644
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,6 @@ Unreleased, experimental changes
 
   Changes affecting code
 
-    A stack-overrun bug has been fixed in 'mktime' and similar functions.
-
     'localtime', 'mktime', etc. now use much less stack space if ALL_STATE
     is defined.  (Thanks to Elliott Hughes for reporting the problem.)
 
diff --git a/localtime.c b/localtime.c
index b45ed0d..ff51d64 100644
--- a/localtime.c
+++ b/localtime.c
@@ -1880,7 +1880,7 @@ time1(struct tm *const tmp,
 	register int			i;
 	register int			nseen;
 	char				seen[TZ_MAX_TYPES];
-	unsigned char			types[TZ_MAX_TIMES];
+	unsigned char			types[TZ_MAX_TYPES];
 	int				okay;
 
 	if (tmp == NULL) {
-- 
1.9.1



More information about the tz mailing list