Skip to content

Commit 5aff915

Browse files
authored
Merge pull request #558 from kbrock/tainted_int
Avoid Fixnum
2 parents 8a9f945 + dccd5ad commit 5aff915

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_object.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def attribute_value_to_xml(value, xml)
190190
case value.class.to_s
191191
when 'MiqAePassword' then xml.Password(OPAQUE_PASSWORD)
192192
when 'String' then xml.String(value)
193-
when 'Fixnum' then xml.Fixnum(value)
193+
when 'Fixnum', 'Integer' then xml.Integer(value)
194194
when 'Symbol' then xml.Symbol(value.to_s)
195195
when 'TrueClass', 'FalseClass' then xml.Boolean(value.to_s)
196196
when /MiqAeMethodService::(.*)/ then xml.tag!($1.gsub(/::/, '-'), :object_id => value.object_id, :id => value.id)
@@ -490,7 +490,7 @@ def self.convert_value_based_on_datatype(value, datatype)
490490
return false if datatype == 'FalseClass'
491491
return Time.parse(value).getlocal if 'time'.casecmp?(datatype)
492492
return value.to_sym if 'symbol'.casecmp?(datatype)
493-
return value.to_i if 'integer'.casecmp?(datatype) || datatype == 'Fixnum'
493+
return value.to_i if 'integer'.casecmp?(datatype) || 'fixnum'.casecmp?(datatype)
494494
return value.to_f if 'float'.casecmp?(datatype)
495495
return value.gsub(/[\[\]]/, '').strip.split(/\s*,\s*/) if datatype == 'array' && value.class == String
496496
return decrypt_password(value) if datatype == 'password'

manageiq-automation_engine.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
1919
spec.require_paths = ["lib"]
2020

2121
spec.add_dependency "rubyzip", "~>2.0.0"
22+
spec.add_dependency "drb"
2223

2324
spec.add_development_dependency "manageiq-style"
2425
spec.add_development_dependency "simplecov", ">= 0.21.2"

spec/miq_ae_object_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def value_match(value, xml_value)
329329

330330
context "integer" do
331331
it "returns value to_i" do
332-
%w[Integer integer Fixnum].each { |type| expect(described_class.convert_value_based_on_datatype("45", type)).to eq(45) }
332+
%w[Integer integer].each { |type| expect(described_class.convert_value_based_on_datatype("45", type)).to eq(45) }
333333
end
334334
end
335335

0 commit comments

Comments
 (0)