Skip to content

Commit 2cb2b28

Browse files
committed
Fix NoMethodError for nil:NilClass bug
The 'unless' statement expects there's always a value for USERNAME and PASSWORD. We might as well just set '' as the default value to avoid the NoMethodError mistake. Related to bug rapid7#7140.
1 parent d7d2669 commit 2cb2b28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/msf/core/exploit/smtp_deliver.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def initialize(info = {})
2929
OptString.new('MAILFROM', [ true, 'The FROM address of the e-mail', '[email protected]' ]),
3030
OptString.new('MAILTO', [ true, 'The TO address of the email' ]),
3131
OptString.new('SUBJECT', [ true, 'Subject line of the email' ]),
32-
OptString.new('USERNAME', [ false, 'SMTP Username for sending email' ]),
33-
OptString.new('PASSWORD', [ false, 'SMTP Password for sending email' ]),
32+
OptString.new('USERNAME', [ false, 'SMTP Username for sending email', '' ]),
33+
OptString.new('PASSWORD', [ false, 'SMTP Password for sending email', '' ]),
3434
OptString.new('VERBOSE', [ false, 'Display verbose information' ]),
3535
], Msf::Exploit::Remote::SMTPDeliver)
3636
register_autofilter_ports([ 25, 465, 587, 2525, 25025, 25000])

0 commit comments

Comments
 (0)