Skip to content

Commit f5b4c0c

Browse files
committed
Handle DBus error in KWallet::networkWallet
If the reply is an error trying to interpret the reply as a string will give the error message as string. Feeding that to openWallet() will then try to open that wallet, which makes no sense. Instead check whether the reply is valid and error out otherwise.
1 parent 0873693 commit f5b4c0c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

qtkeychain/keychain_unix.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ void JobPrivate::kwalletWalletFound(QDBusPendingCallWatcher *watcher)
258258
// This allows to wait for user to unlock wallet, e.g. at Plasma startup
259259
iface->setTimeout(0x7FFFFFFF);
260260

261+
if (!reply.isValid()) {
262+
q->emitFinishedWithError(OtherError, reply.error().message());
263+
return;
264+
}
265+
261266
const QDBusPendingReply<int> pendingReply = iface->open(reply.value(), 0, q->service());
262267
auto pendingWatcher = new QDBusPendingCallWatcher(pendingReply, this);
263268
connect(pendingWatcher, &QDBusPendingCallWatcher::finished, this,

0 commit comments

Comments
 (0)