Skip to content

Commit b4a7562

Browse files
committed
Use getpeername_as_array instead of peerinfo
`peerinfo` is intended to be human-readable and can be things like "Remote Pipe" so splitting it here is the wrong thing to do.
1 parent bcf0062 commit b4a7562

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rex/socket/comm/local.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def self.proxy(sock, type, host, port)
358358
talk_mode = 1 # ref: http://help.sap.com/saphelp_dimp50/helpdata/En/f8/bb960899d743378ccb8372215bb767/content.htm
359359
num_rest_nodes = 1
360360

361-
shost, sport = sock.peerinfo.split(":")
361+
_af, shost, sport = sock.getpeername_as_array
362362
first_route_item = [shost, 0, sport, 0, 0].pack("A*CA*cc")
363363
route_data = [first_route_item.length, first_route_item].pack("NA*")
364364
route_data << [host, 0, port.to_s, 0, 0].pack("A*CA*cc")

0 commit comments

Comments
 (0)