Skip to content

Commit e2f0459

Browse files
akallabethfrankosterfeld
authored andcommitted
job: abort if both service and key are empty
From the job description both, service name and key can be empty strings. Since in that case there is no way to identify more than one entry assume this is invalid and return an error
1 parent 7ad9b09 commit e2f0459

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

qtkeychain/keychain.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ void Job::emitFinishedWithError(Error error, const QString &errorString)
7979

8080
void Job::scheduledStart()
8181
{
82+
if (d->service.isEmpty() && d->key.isEmpty()) {
83+
emitFinishedWithError(EntryNotFound, tr("Both service name and key are empty"));
84+
return;
85+
}
8286
d->scheduledStart();
8387
}
8488

0 commit comments

Comments
 (0)