Skip to content

Commit 650f200

Browse files
committed
merge revision(s) 44884: [Backport ruby#9498]
* lib/resolv.rb (Resolv::DNS::Message::MessageDecoder): Raise DecodeError if no data before the limit. Reported by Will Bryant. [ruby-core:60557] [Bug ruby#9498] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent cf3896b commit 650f200

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Sat Feb 22 14:07:04 2014 Tanaka Akira <[email protected]>
2+
3+
* lib/resolv.rb (Resolv::DNS::Message::MessageDecoder): Raise
4+
DecodeError if no data before the limit.
5+
Reported by Will Bryant. [ruby-core:60557] [Bug #9498]
6+
17
Sat Feb 22 13:49:30 2014 Shugo Maeda <[email protected]>
28

39
* vm_insnhelper.c (vm_call_method): should check ci->me->flag of

lib/resolv.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,6 +1520,7 @@ def get_length16
15201520
end
15211521

15221522
def get_bytes(len = @limit - @index)
1523+
raise DecodeError.new("limit exceeded") if @limit < @index + len
15231524
d = @data[@index, len]
15241525
@index += len
15251526
return d
@@ -1547,6 +1548,7 @@ def get_unpack(template)
15471548
end
15481549

15491550
def get_string
1551+
raise DecodeError.new("limit exceeded") if @limit <= @index
15501552
len = @data[@index].ord
15511553
raise DecodeError.new("limit exceeded") if @limit < @index + 1 + len
15521554
d = @data[@index + 1, len]
@@ -1570,6 +1572,7 @@ def get_labels(limit=nil)
15701572
limit = @index if !limit || @index < limit
15711573
d = []
15721574
while true
1575+
raise DecodeError.new("limit exceeded") if @limit <= @index
15731576
case @data[@index].ord
15741577
when 0
15751578
@index += 1

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.1"
22
#define RUBY_RELEASE_DATE "2014-02-22"
3-
#define RUBY_PATCHLEVEL 53
3+
#define RUBY_PATCHLEVEL 54
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 2

0 commit comments

Comments
 (0)