From ee8838eea5d4eaebbece686abcaaa51ed307c45c Mon Sep 17 00:00:00 2001 From: BuildTools Date: Wed, 14 Apr 2021 17:47:19 -0400 Subject: [PATCH] added validation to make sure the file path is set --- modules/post/osx/gather/gitignore.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/post/osx/gather/gitignore.rb b/modules/post/osx/gather/gitignore.rb index 195d922ad6..03cc9be204 100644 --- a/modules/post/osx/gather/gitignore.rb +++ b/modules/post/osx/gather/gitignore.rb @@ -30,9 +30,13 @@ class MetasploitModule < Msf::Post print_good(ignore.to_s) end elsif mode == 2 - gitignore = cmd_exec("cat #{file}").chomp - print_good(file.to_s) - print_good(gitignore.to_s) + if !file.to_s.empty? + gitignore = cmd_exec("cat #{file}").chomp + print_good(file.to_s) + print_good(gitignore.to_s) + else + print_error('Please set the FILE path!') + end end end end