Supply exception message when raising BadcharError and fix typo

This commit is contained in:
Grant Willcox
2023-03-02 17:46:21 -06:00
parent 5b82c952ba
commit 975de9d479
+2 -2
View File
@@ -26,10 +26,10 @@ class MetasploitModule < Msf::Encoder
raise BadcharError if state.badchars.include?(c)
end
# Modern versions of PHP choke on unquoted litteral strings.
# Modern versions of PHP choke on unquoted literal strings.
quote = "'"
if state.badchars.include?("'")
raise BadcharError if state.badchars.include?('"')
raise BadcharError.new, "The #{self.name} encoder failed to encode the decoder stub without bad characters." if state.badchars.include?('"')
quote = '"'
end