Skip to content

Commit 7668a63

Browse files
yaoxpfrankosterfeld
authored andcommitted
Fix the crash caused by timeout when reading or writing keychain on macOS
Reproduction method: Enter the password when reading or writing the keychain for the first time. If the input is slow and causes the read or write timeout, the application will crash.
1 parent d972099 commit 7668a63

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

qtkeychain/keychain_apple.mm

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,10 @@ - (void)keychainTaskFinished
122122

123123
- (void)keychainReadTaskFinished:(NSData *)retrievedData
124124
{
125-
_privateJob->data.clear();
126-
_privateJob->mode = JobPrivate::Binary;
127-
128-
if (retrievedData != nil) {
129-
if (_privateJob) {
125+
if (_privateJob) {
126+
_privateJob->data.clear();
127+
_privateJob->mode = JobPrivate::Binary;
128+
if (retrievedData != nil) {
130129
_privateJob->data = QByteArray::fromNSData(retrievedData);
131130
}
132131
}

0 commit comments

Comments
 (0)