summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-09 07:43:08 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-09 07:43:08 +0000
commit572e4807e6400e1f319d01ef88b1123d4c99efce (patch)
treed84b56124be9ede58f12d7dd02afa5e8eafbeea2 /win32
parent9cd8b76e6df560d1da61138e99eab76b7c3e1f6b (diff)
* win32/win32.c (unixtime_to_filetime): should check the return value
of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c3
1 files changed, 3 insertions, 0 deletions
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;