Skip to content

Commit c86b566

Browse files
committed
Fix bug preventing updates in pro
The RPC code previously tested return values to see if an error key was equal to true. In 251c284, this was changed to check if the error key was truthy. The pro updater returns an error key with a string describing an error (or an empty string for no error). Ruby strings evaluate as truthy which caused the new behavior to throw an error. This prevented checking for and applying updates. This reverts to the original behavior of checking for true explicitly instead of checking for a truthy value. MSP-12235
1 parent eedfd53 commit c86b566

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/msf/core/rpc/v10/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def call(meth, *args)
7272
if res && [200, 401, 403, 500].include?(res.code)
7373
resp = MessagePack.unpack(res.body)
7474

75-
if resp && resp.kind_of?(::Hash) && resp['error']
75+
if resp && resp.kind_of?(::Hash) && resp['error'] == true
7676
raise Msf::RPC::ServerException.new(resp['error_code'] || res.code, resp['error_message'] || resp['error_string'], resp['error_class'], resp['error_backtrace'])
7777
end
7878

0 commit comments

Comments
 (0)