summaryrefslogtreecommitdiff
path: root/lib/resolv-replace.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-08 01:58:40 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-08 01:58:40 +0000
commit45738f1dab391c665867d026170d45964d5f785e (patch)
tree42bb138c97ec62341bc391b2ff8b6125adaf297c /lib/resolv-replace.rb
parent39a7b1590d789ad6120028df71bdb858581d12e7 (diff)
* lib/resolv.rb: randomize source port and transaction id.
CVE-2008-1447. * lib/resolv-replace.rb (UDPSocket#bind): don't resolv host if host is "". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@18424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/resolv-replace.rb')
-rw-r--r--lib/resolv-replace.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/resolv-replace.rb b/lib/resolv-replace.rb
index 5d15b4577c..63d58cea27 100644
--- a/lib/resolv-replace.rb
+++ b/lib/resolv-replace.rb
@@ -23,7 +23,8 @@ end
class UDPSocket
alias original_resolv_bind bind
def bind(host, port)
- original_resolv_bind(IPSocket.getaddress(host), port)
+ host = IPSocket.getaddress(host) if host != ""
+ original_resolv_bind(host, port)
end
alias original_resolv_connect connect