Skip to content

Commit b701048

Browse files
committed
Fix data_disconnect to shutdown only if datasocket
Seeing people use this with ensure when their data channel was never set up. This breaks things. :)
1 parent 58112d7 commit b701048

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/msf/core/exploit/ftp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def data_connect(mode = nil, nsock = self.sock)
9696
# This method handles disconnecting our data channel
9797
#
9898
def data_disconnect
99-
self.datasocket.shutdown
99+
self.datasocket.shutdown if self.datasocket
100100
self.datasocket = nil
101101
end
102102

0 commit comments

Comments
 (0)