Project

General

Profile

Actions

Backport #5596

closed

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

Added by dearblue (宗介 相良) about 13 years ago. Updated almost 13 years ago.

Status:
Closed
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 ポインタを参照するためです。

対応をお願いします。

Actions #1

Updated by usa (Usaku NAKAMURA) about 13 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]
Actions #2

Updated by usa (Usaku NAKAMURA) about 13 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は必要なし。

Actions #3

Updated by usa (Usaku NAKAMURA) almost 13 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]

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0