mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/resolv.rb (Resolv::DNS::Message::MessageDecoder::get_string):
affected by str[0] returns 1 char string. [ruby-dev:29223] * lib/resolv.rb (Resolv::DNS::Message::MessageDecoder::get_labels): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6297f4c8bc
commit
8b5942801d
3 changed files with 12 additions and 3 deletions
|
@ -1330,6 +1330,7 @@ class Resolv
|
|||
def get_unpack(template)
|
||||
len = 0
|
||||
template.each_byte {|byte|
|
||||
byte = "%c" % byte
|
||||
case byte
|
||||
when ?c, ?C
|
||||
len += 1
|
||||
|
@ -1348,7 +1349,7 @@ class Resolv
|
|||
end
|
||||
|
||||
def get_string
|
||||
len = @data[@index]
|
||||
len = @data[@index].ord
|
||||
raise DecodeError.new("limit exceeded") if @limit < @index + 1 + len
|
||||
d = @data[@index + 1, len]
|
||||
@index += 1 + len
|
||||
|
@ -1371,7 +1372,7 @@ class Resolv
|
|||
limit = @index if !limit || @index < limit
|
||||
d = []
|
||||
while true
|
||||
case @data[@index]
|
||||
case @data[@index].ord
|
||||
when 0
|
||||
@index += 1
|
||||
return d
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue