diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | win32/win32.c | 3 |
2 files changed, 9 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Wed Nov 9 16:40:49 2011 NAKAMURA Usaku <usa@ruby-lang.org> + + * win32/win32.c (unixtime_to_filetime): should check the return value + of localtime(). reported by snowjail at gmail.com. + [ruby-dev:44838] [Bug #5596] + Thu Nov 10 05:17:25 2011 Koichi Sasada <ko1@atdot.net> * cont.c (rb_fiber_m_transfer, rb_fiber_resume): prohibit using diff --git a/win32/win32.c b/win32/win32.c index fc1cd29b2d..b570a4295d 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -5758,6 +5758,9 @@ unixtime_to_filetime(time_t time, FILETIME *ft) FILETIME lt; tm = localtime(&time); + if (!tm) { + return -1; + } st.wYear = tm->tm_year + 1900; st.wMonth = tm->tm_mon + 1; st.wDayOfWeek = tm->tm_wday; |