Fix crash in [NSURLConnectionVCR connection:didReceiveData]

Merged
#2 · Created  · Last updated

Merged pull request

Merged in dlackty/nsurlconnectionvcr/fix-expectedContentLength (pull request #2)

13fa7e5·Author: ·Closed by: ·2013-10-07

Description

In NSURLConnectionVCR.m #365 line, there's a code snippets as below.

long long expectedContentLength = [response expectedContentLength]; responseData = [NSMutableData dataWithCapacity:expectedContentLength];

where [response expectedContentLength] might return -1 as suggested by Cocoa official doc, which will cause a crash for [NSMutableData dataWithCapacity:expectedContentLength].

This should also close issue #1. Please help review, and let me know if there's any problem. Thanks!

0 attachments

0 comments

Loading commits...