aboutsummaryrefslogtreecommitdiffstats
path: root/src/ChangeLog
diff options
context:
space:
mode:
authorPaul Eggert2012-05-02 16:25:46 -0700
committerPaul Eggert2012-05-02 16:25:46 -0700
commit7ed806a75c15de00d60ef37f347b5800370fb77c (patch)
tree544c50daa8065996076ab015e73788cc92ea0edf /src/ChangeLog
parent99d2758343245de1ac452a9b8d1f4c1521f8c8d6 (diff)
downloademacs-7ed806a75c15de00d60ef37f347b5800370fb77c.tar.gz
emacs-7ed806a75c15de00d60ef37f347b5800370fb77c.zip
Fix race conditions involving setenv, gmtime, localtime, asctime.
Without this fix, interrupts could mess up code that uses these nonreentrant functions, since setting TZ invalidates existing tm_zone or tzname values, and since most of these functions return pointers to static storage. * editfns.c (format_time_string, Fdecode_time, Fencode_time) (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule): Grow the critical sections to include not just invoking localtime/gmtime, but also accessing these functions' results including their tm_zone values if any, and any related TZ setting. (format_time_string): Last arg is now struct tm *, not struct tm **, so that the struct tm is saved in the critical section. All callers changed. Simplify allocation of initial buffer, partly motivated by the fact that memory allocation needs to be outside the critical section.
Diffstat (limited to 'src/ChangeLog')
-rw-r--r--src/ChangeLog18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 01e137d2fcc..bf297616e82 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
12012-05-02 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix race conditions involving setenv, gmtime, localtime, asctime.
4 Without this fix, interrupts could mess up code that uses these
5 nonreentrant functions, since setting TZ invalidates existing
6 tm_zone or tzname values, and since most of these functions return
7 pointers to static storage.
8 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
10 Grow the critical sections to include not just invoking
11 localtime/gmtime, but also accessing these functions' results
12 including their tm_zone values if any, and any related TZ setting.
13 (format_time_string): Last arg is now struct tm *, not struct tm **,
14 so that the struct tm is saved in the critical section. All
15 callers changed. Simplify allocation of initial buffer, partly
16 motivated by the fact that memory allocation needs to be outside
17 the critical section.
18
12012-05-02 Dmitry Antipov <dmantipov@yandex.ru> 192012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
2 20
3 * intervals.c (adjust_intervals_for_insertion): Initialize `newi' 21 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'