Skip to content

Commit 0deb2c0

Browse files
nicolasfellafrankosterfeld
authored andcommitted
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 0deb2c0

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)