incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject ios commit: Fix null dereference in file upload when URL is invalid.
Date Wed, 05 Sep 2012 18:48:13 GMT
Updated Branches:
  refs/heads/master f90626c67 -> e1781b030


Fix null dereference in file upload when URL is invalid.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/e1781b03
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/e1781b03
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/e1781b03

Branch: refs/heads/master
Commit: e1781b0302ff51cb65581f08b783a420f6371ede
Parents: f90626c
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Wed Sep 5 14:46:31 2012 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Wed Sep 5 14:47:29 2012 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/CDVFileTransfer.m |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/e1781b03/CordovaLib/Classes/CDVFileTransfer.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFileTransfer.m b/CordovaLib/Classes/CDVFileTransfer.m
index d0cb145..3115f34 100644
--- a/CordovaLib/Classes/CDVFileTransfer.m
+++ b/CordovaLib/Classes/CDVFileTransfer.m
@@ -267,8 +267,10 @@ static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream)
{
     // fileData and req are split into helper functions to ease the unit testing of delegateForUpload.
     NSData* fileData = [self fileDataForUploadCommand:command];
     NSURLRequest* req = [self requestForUploadCommand:command fileData:fileData];
-    CDVFileTransferDelegate* delegate = [self delegateForUploadCommand:command];
-	[NSURLConnection connectionWithRequest:req delegate:delegate];
+    if (req != nil) {
+        CDVFileTransferDelegate* delegate = [self delegateForUploadCommand:command];
+        [NSURLConnection connectionWithRequest:req delegate:delegate];
+    }
 }
 
 - (void) download:(CDVInvokedUrlCommand*)command {


Mime
View raw message