From 1d78d20fcf59d772688f9f32d81670548d6569f9 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Wed, 20 Jul 2016 12:48:14 +0600 Subject: CLOUD: Fix Dropbox and Google Drive UploadRequests Possible segfault there too. --- backends/cloud/dropbox/dropboxuploadrequest.cpp | 1 + backends/cloud/googledrive/googledriveuploadrequest.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'backends') diff --git a/backends/cloud/dropbox/dropboxuploadrequest.cpp b/backends/cloud/dropbox/dropboxuploadrequest.cpp index e530502413..a3d7dd0d6d 100644 --- a/backends/cloud/dropbox/dropboxuploadrequest.cpp +++ b/backends/cloud/dropbox/dropboxuploadrequest.cpp @@ -56,6 +56,7 @@ void DropboxUploadRequest::start() { if (!_contentsStream->seek(0)) { warning("DropboxUploadRequest: cannot restart because stream couldn't seek(0)"); finishError(Networking::ErrorResponse(this, false, true, "", -1)); + return; } _ignoreCallback = false; diff --git a/backends/cloud/googledrive/googledriveuploadrequest.cpp b/backends/cloud/googledrive/googledriveuploadrequest.cpp index ce7d59a50c..73a7fbfcac 100644 --- a/backends/cloud/googledrive/googledriveuploadrequest.cpp +++ b/backends/cloud/googledrive/googledriveuploadrequest.cpp @@ -50,9 +50,10 @@ GoogleDriveUploadRequest::~GoogleDriveUploadRequest() { void GoogleDriveUploadRequest::start() { _ignoreCallback = true; if (_workingRequest) _workingRequest->finish(); - if (!_contentsStream->seek(0)) { + if (_contentsStream == nullptr || !_contentsStream->seek(0)) { warning("GoogleDriveUploadRequest: cannot restart because stream couldn't seek(0)"); finishError(Networking::ErrorResponse(this, false, true, "", -1)); + return; } _resolvedId = ""; //used to update file contents _parentId = ""; //used to create file within parent directory -- cgit v1.2.3