Pull requests

#2 Merged
Repository
dlackty
Branch
fix-expectedContentLength
Repository
martijnthe
Branch
master

Fix crash in [NSURLConnectionVCR connection:didReceiveData]

Author
  1. Richard Lee
Reviewers
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!

Comments (1)