Bug fix for a rare edge case with channels. When creating a Rex::Post::Meterpreter::Stream instance we should initialize_abstraction() before super() as we can get a scenario where dio_write_handler() is called with data to write to the rsock but rsock has not yet been initialized. This happens if the channel is registered (client.add_channel(self) in Channel.initialize) to a session and a 'core_channel_write' request comes in before we have called self.initialize_abstraction()

git-svn-id: file:///home/svn/framework3/trunk@8386 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
Stephen Fewer 2010-02-06 20:12:52 +00:00
parent b12ac46d9e
commit e19633354b
1 changed files with 5 additions and 2 deletions

View File

@ -36,9 +36,12 @@ class Stream < Rex::Post::Meterpreter::Channel
# Passes the initialization information up to the base class
#
def initialize(client, cid, type, flags)
super(client, cid, type, flags)
# sf: initialize_abstraction() before super() as we can get a scenario where dio_write_handler() is called
# with data to write to the rsock but rsock has not yet been initialized. This happens if the channel
# is registered (client.add_channel(self) in Channel.initialize) to a session and a 'core_channel_write'
# request comes in before we have called self.initialize_abstraction()
initialize_abstraction
super(client, cid, type, flags)
end
##