From 1ae27ee18a45320cc3ebc60bc3f878db20848079 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 18 Jun 2013 01:50:05 -0400 Subject: [PATCH] Fix use-after-free by not removing the dequeued message until after it is sent. --- Source/MessageQueue.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/MessageQueue.m b/Source/MessageQueue.m index b4c706d..b4e0642 100644 --- a/Source/MessageQueue.m +++ b/Source/MessageQueue.m @@ -232,8 +232,8 @@ static void MessageQueueWriteEvent(CFWriteStreamRef stream, return; NSString* message = [_queue objectAtIndex:0]; - [_queue removeObjectAtIndex:0]; [self performSend:message]; + [_queue removeObjectAtIndex:0]; } - (void)performSend:(NSString*)message { -- 2.43.5