Browse Source

Avoid error when generated payload is nil.

forzoni 3 years ago
parent
commit
b58931f803
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      lib/msf/core/payload_generator.rb

+ 4
- 4
lib/msf/core/payload_generator.rb View File

@@ -333,15 +333,15 @@ module Msf
333 333
         gen_payload = format_payload(encoded_payload)
334 334
       end
335 335
 
336
-      if format.to_s != 'raw'
337
-        cli_print "Final size of #{format} file: #{gen_payload.length} bytes"
338
-      end
339
-
340 336
       if gen_payload.nil?
341 337
         raise PayloadGeneratorError, 'The payload could not be generated, check options'
342 338
       elsif gen_payload.length > @space and not @smallest
343 339
         raise PayloadSpaceViolation, 'The payload exceeds the specified space'
344 340
       else
341
+        if format.to_s != 'raw'
342
+          cli_print "Final size of #{format} file: #{gen_payload.length} bytes"
343
+        end
344
+
345 345
         gen_payload
346 346
       end
347 347
     end

Loading…
Cancel
Save