Skip to content

Commit ca1cc11

Browse files
David MaloneyDavid Maloney
authored andcommitted
Land rapid7#7713, scriptkittie fix for SessionLogging
lands a fix for loggers not handling a nil message Fix for rapid7#7687
2 parents fa016de + e7eece6 commit ca1cc11

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/rex/logging/sinks/timestamp_flatfile.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module Sinks
1212
class TimestampFlatfile < Flatfile
1313

1414
def log(sev, src, level, msg, from) # :nodoc:
15+
return unless msg.present?
1516
msg = msg.chop.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, " ")
1617
fd.write("[#{get_current_timestamp}] #{msg}\n")
1718
fd.flush

lib/rex/ui/text/shell.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ def update_prompt(prompt = nil, new_prompt_char = nil, mode = false)
272272
#
273273
def print_error(msg='')
274274
return if (output.nil?)
275+
return if (msg.nil?)
275276

276277
self.on_print_proc.call(msg) if self.on_print_proc
277278
# Errors are not subject to disabled output

0 commit comments

Comments
 (0)