From a91a29d4e51d53c068b64f5770e11dbf8dc92343 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Sun, 8 Mar 2015 23:51:43 -0500 Subject: [PATCH] Add a comment explaining about the error key --- lib/msf/core/rpc/v10/client.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/msf/core/rpc/v10/client.rb b/lib/msf/core/rpc/v10/client.rb index 77b20b959c..2975ddbf7d 100644 --- a/lib/msf/core/rpc/v10/client.rb +++ b/lib/msf/core/rpc/v10/client.rb @@ -72,6 +72,8 @@ class Client if res && [200, 401, 403, 500].include?(res.code) resp = MessagePack.unpack(res.body) + # Boolean true versus truthy check required here; + # RPC responses such as { "error" => "Here I am" } and { "error" => "" } must be accommodated. if resp && resp.kind_of?(::Hash) && resp['error'] == true raise Msf::RPC::ServerException.new(resp['error_code'] || res.code, resp['error_message'] || resp['error_string'], resp['error_class'], resp['error_backtrace']) end