about summary refs log tree commit diff
path: root/ChangeLog
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-11-15 22:59:33 +0100
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>2018-11-15 22:59:33 +0100
commit86aece3bfbd44538ba4fdc947872c81d4c5e6e61 (patch)
tree1bf096dc1c3f3f671a48f2b8f8ef28ddf50c21d7 /ChangeLog
parentf6b3331bbae638d1bb50813fceb429d3b3dc0eb9 (diff)
downloadglibc-86aece3bfbd44538ba4fdc947872c81d4c5e6e61.tar.gz
glibc-86aece3bfbd44538ba4fdc947872c81d4c5e6e61.tar.xz
glibc-86aece3bfbd44538ba4fdc947872c81d4c5e6e61.zip
mktime: fix non-EOVERFLOW errno handling
[BZ#23789]
mktime was not properly reporting failures when the underlying
localtime_r fails with errno != EOVERFLOW; it incorrectly treated
them like EOVERFLOW failures, and set errno to EOVERFLOW.
The problem could happen on non-glibc platforms, with Gnulib.
* time/mktime.c (guess_time_tm): Remove, replacing with ...
(tm_diff): ... this simpler function, which does not change errno.
All callers changed to deal with errno themselves.
(ranged_convert, __mktime_internal): Return failure immediately if
the underlying function reports any failure other than EOVERFLOW.
(__mktime_internal): Set errno to EOVERFLOW if the spring-forward
gap code fails.
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog14
1 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d503a3e65f..f4b6d06eae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2018-11-15  Paul Eggert  <eggert@cs.ucla.edu>
 
+	mktime: fix non-EOVERFLOW errno handling
+	[BZ#23789]
+	mktime was not properly reporting failures when the underlying
+	localtime_r fails with errno != EOVERFLOW; it incorrectly treated
+	them like EOVERFLOW failures, and set errno to EOVERFLOW.
+	The problem could happen on non-glibc platforms, with Gnulib.
+	* time/mktime.c (guess_time_tm): Remove, replacing with ...
+	(tm_diff): ... this simpler function, which does not change errno.
+	All callers changed to deal with errno themselves.
+	(ranged_convert, __mktime_internal): Return failure immediately if
+	the underlying function reports any failure other than EOVERFLOW.
+	(__mktime_internal): Set errno to EOVERFLOW if the spring-forward
+	gap code fails.
+
 	mktime: fix bug with Y2038 DST transition
 	[BZ#23789]
 	* time/mktime.c (ranged_convert): On 32-bit platforms, don’t