From 79660cc67d6f224e940ee3082a19588f5a2bdd6f Mon Sep 17 00:00:00 2001 From: Jonathan Claudius Date: Thu, 17 Jan 2019 08:55:00 -0500 Subject: [PATCH] Fix no methoding when stdout is nil --- lib/ssh_scan/scan_engine.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ssh_scan/scan_engine.rb b/lib/ssh_scan/scan_engine.rb index 631be1b2..7526e10f 100644 --- a/lib/ssh_scan/scan_engine.rb +++ b/lib/ssh_scan/scan_engine.rb @@ -126,7 +126,9 @@ def scan_target(socket, opts) cmd = ['ssh-keyscan', '-t', 'rsa,dsa', '-p', port.to_s, target].join(" ") Utils::Subprocess.new(cmd) do |stdout, stderr, thread| - output += stdout + if stdout + output += stdout + end end host_keys = output.split