Skip to content

Commit 8bda3c6

Browse files
author
Brent Cook
committed
Land rapid7#7121, Don't clobber nil strings when there are empty strings in the config file
2 parents 190bac6 + b1efd4e commit 8bda3c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/rex/parser/ini.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,12 @@ def read_groups_string(str) # :nodoc:
165165
# Is it a VAR=VAL?
166166
elsif (md = line.match(/^(.+?)=(.*)$/))
167167
if (active_group)
168-
self[active_group][md[1]] = md[2]
168+
var, val = md[1], md[2]
169+
170+
# don't clobber datastore nils with ""
171+
unless val.empty?
172+
self[active_group][var] = val
173+
end
169174
end
170175
end
171176
}

0 commit comments

Comments
 (0)