# HG changeset patch # User Jens Alfke # Date 1212180878 25200 # Node ID 980beba83fb7f25e618c9e2861fdb53bf66d3136 # Parent 6f539dd9921cdb79b677e9859b81526f218e9d7a Fixed a serious bug - a race condition where a data buffer in the writer's queue could be dealloced (not the NSData, but its bytes themselves) before the writer sent it, resulting in an EFAULT error. diff -r 6f539dd9921c -r 980beba83fb7 BLIP/BLIPMessage.m --- a/BLIP/BLIPMessage.m Thu May 29 16:40:36 2008 -0700 +++ b/BLIP/BLIPMessage.m Fri May 30 13:54:38 2008 -0700 @@ -256,9 +256,8 @@ // Then write the body: if( lengthToWrite > 0 ) { - [writer writeData: [NSData dataWithBytesNoCopy: (UInt8*)_encodedBody.bytes + _bytesWritten - length: lengthToWrite - freeWhenDone: NO]]; + [writer writeData: [NSData dataWithBytes: (UInt8*)_encodedBody.bytes + _bytesWritten + length: lengthToWrite]]; _bytesWritten += lengthToWrite; } return (flags & kBLIP_MoreComing) != 0;