Project

General

Profile

Bug #14369

Win32::Resolv.get_hosts_path may return nil, causing Resolv to fail

Added by docwhat (Christian Höltje) almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:84907]

Description

Win32::Resolv.get_hosts_path() may return nil.

The Resolv class uses that to get the hosts filename which is used as the default when initializing Hosts as @filename.

However, File.open(@filename, 'rb') is always called, even if @filename is nil.

This causes the error: TypeError: no implicit conversion of nil into String

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

What configuration causes it?
No TCP/IP stack?

#3

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r61898.


resolv.rb: NUL hosts

  • lib/resolv.rb (Resolv::Hosts::DefaultFileName): fallback to NUL device when Win32::Resolv.get_hosts_path() returned nil, to get rid of TypeError in lazy_initialize. [ruby-core:84907] [Bug #14369] [Fix GH-1791]

Also available in: Atom PDF