mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
fix(cfapi): check for valid ProcessInfo in cfApiFetchDataCallback
This shouldn't happen, but just in case it does it'll avoid another crash. Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
This commit is contained in:
parent
102e4447f8
commit
684e29e18c
@ -130,8 +130,6 @@ void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const
|
||||
{
|
||||
qCDebug(lcCfApiWrapper) << "Fetch data callback called. File size:" << callbackInfo->FileSize.QuadPart;
|
||||
qCInfo(lcCfApiWrapper) << "Desktop client process id:" << QCoreApplication::applicationPid();
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by process id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
|
||||
const auto sendTransferError = [=] {
|
||||
cfApiSendTransferInfo(callbackInfo->ConnectionKey,
|
||||
@ -158,6 +156,15 @@ void CALLBACK cfApiFetchDataCallback(const CF_CALLBACK_INFO *callbackInfo, const
|
||||
const auto path = QString(QString::fromWCharArray(callbackInfo->VolumeDosName) + QString::fromWCharArray(callbackInfo->NormalizedPath));
|
||||
const auto requestId = QString::number(callbackInfo->TransferKey.QuadPart, 16);
|
||||
|
||||
if (!callbackInfo->ProcessInfo) {
|
||||
qCCritical(lcCfApiWrapper) << "Callback parameters did not contain required process info required for the implicit hydration check, aborting" << path << requestId;
|
||||
sendTransferError();
|
||||
return;
|
||||
}
|
||||
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by process id:" << callbackInfo->ProcessInfo->ProcessId;
|
||||
qCInfo(lcCfApiWrapper) << "Fetch data requested by application id:" << QString(QString::fromWCharArray(callbackInfo->ProcessInfo->ApplicationId));
|
||||
|
||||
if (QCoreApplication::applicationPid() == callbackInfo->ProcessInfo->ProcessId) {
|
||||
qCCritical(lcCfApiWrapper) << "implicit hydration triggered by the client itself. Will lead to a deadlock. Cancel" << path << requestId;
|
||||
sendTransferError();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user