diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-05-02 16:25:46 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-05-02 16:25:46 -0700 |
commit | 7ed806a75c15de00d60ef37f347b5800370fb77c (patch) | |
tree | 544c50daa8065996076ab015e73788cc92ea0edf /lisp/custom.el | |
parent | 99d2758343245de1ac452a9b8d1f4c1521f8c8d6 (diff) | |
download | emacs-7ed806a75c15de00d60ef37f347b5800370fb77c.tar.gz |
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 'lisp/custom.el')
0 files changed, 0 insertions, 0 deletions