Add empty string check

This commit is contained in:
William Vu 2019-07-18 14:23:14 -05:00
parent f0b758e956
commit 77a442a1c3
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ module Rex::Text
xor_key = [xor_key].pack('C')
end
# Check for empty strings
if xor_key.empty? || value.empty?
raise ArgumentError, 'XOR key and value must not be empty'
end
# Get byte arrays for key and value
xor_key = xor_key.bytes
xor_value = value.bytes