File tree 4 files changed +10
-5
lines changed
Keychain/Sources/Keychain
4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public extension Keychain {
64
64
guard let data = read ( Data . self, usingQuery: query. rawQuery) else {
65
65
return nil
66
66
}
67
- return String ( decoding : data, as : UTF8 . self )
67
+ return String ( data : data, encoding : . utf8 )
68
68
}
69
69
70
70
func removePassword( forAccount account: String , belongingToService service: String ) {
Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ public final class RSAPrivateKey {
24
24
}
25
25
26
26
public convenience init ? ( _ data: Data ) {
27
- let string = String ( decoding: data, as: UTF8 . self)
27
+ guard let string = String ( data: data, encoding: . utf8) else {
28
+ return nil
29
+ }
28
30
self . init ( string)
29
31
}
30
32
Original file line number Diff line number Diff line change @@ -18,13 +18,16 @@ public struct ProcessShell: Shell {
18
18
process. launchPath = executablePath
19
19
process. standardInput = nil
20
20
process. environment = environment
21
- process. launch ( )
21
+ try process. run ( )
22
22
let data = pipe. fileHandleForReading. readDataToEndOfFile ( )
23
+ // Explicitly close the pipe file handle to prevent running out of file descriptors.
24
+ // See https://github.com/swiftlang/swift/issues/57827
25
+ try pipe. fileHandleForReading. close ( )
23
26
process. waitUntilExit ( )
24
27
guard process. terminationStatus == 0 else {
25
28
throw ProcessShellError . unexpectedTerminationStatus ( process. terminationStatus)
26
29
}
27
- return String ( decoding : data, as : UTF8 . self )
30
+ return String ( data : data, encoding : . utf8 ) ?? " "
28
31
} onCancel: {
29
32
if sendableProcess. process. isRunning {
30
33
sendableProcess. process. terminate ( )
Original file line number Diff line number Diff line change 1
1
GENERATE_INFOPLIST_FILE = YES
2
2
CURRENT_PROJECT_VERSION = 1
3
- MARKETING_VERSION = 0.9.0
3
+ MARKETING_VERSION = 0.10.1
4
4
DEVELOPMENT_TEAM = 566MC7D8D4
5
5
CODE_SIGN_STYLE = Automatic
6
6
CODE_SIGN_ENTITLEMENTS = Tartelet/Supporting files/Tartelet.entitlements
You can’t perform that action at this time.
0 commit comments