From e7eece60d802ecbba03374eb4884e27c11ff8a80 Mon Sep 17 00:00:00 2001 From: David Maloney Date: Thu, 15 Dec 2016 14:41:49 -0600 Subject: [PATCH] add a nil catch to timestamp file sink an additional nil guard is needed here just to be sure --- lib/rex/logging/sinks/timestamp_flatfile.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rex/logging/sinks/timestamp_flatfile.rb b/lib/rex/logging/sinks/timestamp_flatfile.rb index bb8fe132b8..b7fa229922 100644 --- a/lib/rex/logging/sinks/timestamp_flatfile.rb +++ b/lib/rex/logging/sinks/timestamp_flatfile.rb @@ -12,6 +12,7 @@ module Sinks class TimestampFlatfile < Flatfile def log(sev, src, level, msg, from) # :nodoc: + return unless msg.present? msg = msg.chop.gsub(/\x1b\[[0-9;]*[mG]/,'').gsub(/[\x01-\x02]/, " ") fd.write("[#{get_current_timestamp}] #{msg}\n") fd.flush