Project

General

Profile

Backport #5596

Windows上でFile.utimeにtime_tの負の値を与えるとSEGV

Added by dearblue (宗介 相良) almost 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-dev:44838]

Description

Windows 上で File.utime に time_t の負の値を与えると SEGV します。

ruby -e "t = Time.at(-1); File.utime(t, t, '.')"
-e:1: [BUG] Segmentation fault

原因は win32/win32.c の unixtime_to_filetime で呼び出される localtime 関数の戻り値を確認していないため、NULL ポインタを参照するためです。

対応をお願いします。

Associated revisions

Revision 572e4807
Added by usa (Usaku NAKAMURA) almost 8 years ago

  • 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

Revision 33685
Added by usa (Usaku NAKAMURA) almost 8 years ago

  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]

Revision 33685
Added by usa (Usaku NAKAMURA) almost 8 years ago

  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]

Revision 33685
Added by usa (Usaku NAKAMURA) almost 8 years ago

  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]

Revision 33685
Added by usa (Usaku NAKAMURA) almost 8 years ago

  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]

Revision 33685
Added by usa (Usaku NAKAMURA) almost 8 years ago

  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]

Revision 33685
Added by usa (Usaku NAKAMURA) almost 8 years ago

  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]

Revision ad837e5a
Added by usa (Usaku NAKAMURA) over 7 years ago

merge rivision(s) 33685:

  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]

[Backport #5596]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 34438
Added by usa (Usaku NAKAMURA) over 7 years ago

merge rivision(s) 33685:

  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]

[Backport #5596]

History

#1

Updated by usa (Usaku NAKAMURA) almost 8 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r33685.
宗介, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]
#2

Updated by usa (Usaku NAKAMURA) almost 8 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport193
  • Status changed from Closed to Open
  • Target version deleted (1.9.3)

要backport (1.9.3, 1.9.2)
1.8は必要なし。

#3

Updated by usa (Usaku NAKAMURA) over 7 years ago

  • Status changed from Open to Closed

This issue was solved with changeset r34438.
宗介, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge rivision(s) 33685:

  • win32/win32.c (unixtime_to_filetime): should check the return value of localtime(). reported by snowjail at gmail.com. [ruby-dev:44838] [Bug #5596]

[Backport #5596]

Also available in: Atom PDF