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 16, 2024
1 parent ef811ff commit ddaaf2c
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 @@ -696,6 +696,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.")});

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
deleteLater();
return;
}

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

0 comments on commit ddaaf2c

Please sign in to comment.