Skip to content

Commit

Permalink
Fail with error before calling folder metada setup when received empt…
Browse files Browse the repository at this point in the history
…y signature.

Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Oct 14, 2024
1 parent 5fd17f5 commit 299ac60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libsync/discoveryphase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,14 @@ void DiscoverySingleDirectoryJob::metadataReceived(const QJsonDocument &json, in
}
}

if (job->signature().isEmpty()) {
qCDebug(lcDiscovery) << "Initial signature is empty.";
_account->reportClientStatus(OCC::ClientStatusReportingStatus::E2EeError_GeneralError);
emit finished(HttpError{0, tr("Encrypted metadata setup error: initial signature from server is empty.")});
deleteLater();

Check warning on line 702 in src/libsync/discoveryphase.cpp

View workflow job for this annotation

GitHub Actions / build

src/libsync/discoveryphase.cpp:702:14 [cppcoreguidelines-init-variables]

variable 'finished' is not initialized
return;
}

const auto e2EeFolderMetadata = new FolderMetadata(_account,
_remoteRootFolderPath,
statusCode == 404 ? QByteArray{} : json.toJson(QJsonDocument::Compact),
Expand Down

0 comments on commit 299ac60

Please sign in to comment.