Project

General

Profile

Backport #8950 ยป rubygems.2_0_10.ruby.2_0_0.patch

drbrain (Eric Hodel), 09/25/2013 10:04 AM

View differences:

NEWS (working copy)
461 461
    XML declaration is used for XML document encoding.
462 462

  
463 463
* RubyGems
464
  * Updated to 2.0.9.
464
  * Updated to 2.0.10.  This fixes CVE_2013-4363:
465 465

  
466
    http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.0.9+%2F+2013-09-13
466
    http://rubygems.rubyforge.org/rubygems-update/CVE-2013-4363_txt.html
467

  
468
    See http://rubygems.rubyforge.org/rubygems-update/History_txt.html#label-2.0.10+%2F+2013-09-24
467 469
    for release notes.
468 470

  
469 471
  * Updated to 2.0.8.  This fixes CVE-2013-4287:
lib/rubygems/version.rb (working copy)
148 148
  # FIX: These are only used once, in .correct?. Do they deserve to be
149 149
  # constants?
150 150
  VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*' # :nodoc:
151
  ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
151
  ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
152 152

  
153 153
  ##
154 154
  # A string representation of this Version.
lib/rubygems.rb (working copy)
8 8
require 'rbconfig'
9 9

  
10 10
module Gem
11
  VERSION = '2.0.9'
11
  VERSION = '2.0.10'
12 12
end
13 13

  
14 14
# Must be first since it unloads the prelude from 1.9.2
test/rubygems/test_gem_requirement.rb (working copy)
47 47
  end
48 48

  
49 49
  def test_parse_bad
50
    e = assert_raises Gem::Requirement::BadRequirementError do
51
      Gem::Requirement.parse nil
52
    end
53

  
54
    assert_equal 'Illformed requirement [nil]', e.message
50
    [
51
      nil,
52
      '',
53
      '! 1',
54
      '= junk',
55
      '1..2',
56
    ].each do |bad|
57
      e = assert_raises Gem::Requirement::BadRequirementError do
58
        Gem::Requirement.parse bad
59
      end
55 60

  
56
    e = assert_raises Gem::Requirement::BadRequirementError do
57
      Gem::Requirement.parse ""
61
      assert_equal "Illformed requirement [#{bad.inspect}]", e.message
58 62
    end
59 63

  
60
    assert_equal 'Illformed requirement [""]', e.message
61

  
62 64
    assert_equal Gem::Requirement::BadRequirementError.superclass, ArgumentError
63 65
  end
64 66

  
test/rubygems/test_gem_version.rb (working copy)
67 67
  end
68 68

  
69 69
  def test_initialize_bad
70
    ["junk", "1.0\n2.0"].each do |bad|
71
      e = assert_raises ArgumentError do
70
    %W[
71
      junk
72
      1.0\n2.0
73
      1..2
74
      1.2\ 3.4
75
      1-2-3
76
    ].each do |bad|
77
      e = assert_raises ArgumentError, bad do
72 78
        Gem::Version.new bad
73 79
      end
74 80

  
75
      assert_equal "Malformed version number string #{bad}", e.message
81
      assert_equal "Malformed version number string #{bad}", e.message, bad
76 82
    end
77 83
  end
78 84