Index: webrtc/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m |
diff --git a/webrtc/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m b/webrtc/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m |
index b4868a7898400a582c673afad688c2502da6a21c..b9148cd384f07332305b330171e34269945f8f79 100644 |
--- a/webrtc/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m |
+++ b/webrtc/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m |
@@ -504,7 +504,7 @@ static __strong NSData *CRLFCRLF; |
CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Host"), (__bridge CFStringRef)(_url.port ? [NSString stringWithFormat:@"%@:%@", _url.host, _url.port] : _url.host)); |
NSMutableData *keyBytes = [[NSMutableData alloc] initWithLength:16]; |
- SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes); |
+ assert(!SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes)); |
if ([keyBytes respondsToSelector:@selector(base64EncodedStringWithOptions:)]) { |
_secKey = [keyBytes base64EncodedStringWithOptions:0]; |
@@ -528,7 +528,7 @@ static __strong NSData *CRLFCRLF; |
[_urlRequest.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { |
CFHTTPMessageSetHeaderFieldValue(request, (__bridge CFStringRef)key, (__bridge CFStringRef)obj); |
}]; |
- |
+ |
NSData *message = CFBridgingRelease(CFHTTPMessageCopySerializedMessage(request)); |
CFRelease(request); |
@@ -1361,7 +1361,7 @@ static const size_t SRFrameHeaderOverhead = 32; |
} |
} else { |
uint8_t *mask_key = frame_buffer + frame_buffer_size; |
- SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key); |
+ assert(!SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key)); |
frame_buffer_size += sizeof(uint32_t); |
// TODO: could probably optimize this with SIMD |