Skip to content

Commit 29d6cf4

Browse files
committed
Fix nil bug in generic/custom and change opt order
I think PAYLOADSTR should take precedence over PAYLOADFILE. Usually, you'll use PAYLOADFILE but might want to override with PAYLOADSTR. I doubt this change will hurt anyone, since few people set both at once. The payload description even says "either," so there's that.
1 parent afd8315 commit 29d6cf4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/payloads/singles/generic/custom.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ def generate
4242
self.arch = actual_arch
4343
end
4444

45-
if datastore['PAYLOADFILE']
46-
IO.read(datastore['PAYLOADFILE'])
47-
elsif datastore['PAYLOADSTR']
45+
if datastore['PAYLOADSTR']
4846
datastore['PAYLOADSTR']
47+
elsif datastore['PAYLOADFILE']
48+
IO.read(datastore['PAYLOADFILE'])
49+
else
50+
''
4951
end
5052
end
5153

0 commit comments

Comments
 (0)