[iOS] Fix missing 0 byte after passphrase

FossilOrigin-Name: b57405c1d07a52c27807f6fe19eff1b1277663f051690a3a3336dc626c6f4825
This commit is contained in:
Jonathan Schleifer 2022-06-18 15:28:21 +00:00
parent df23f59e9d
commit e74d034db4

View file

@ -153,8 +153,8 @@ class ShowDetailsController: UITableViewController, UITextFieldDelegate {
}
let passphraseText = (passphraseField?.text ?? "") as NSString
let passphraseLen =
passphraseText.lengthOfBytes(using: String.Encoding.utf8.rawValue)
let passphraseLen = passphraseText.lengthOfBytes(
using: String.Encoding.utf8.rawValue) + 1
let passphrase = OFSecureData(count: passphraseLen,
allowsSwappableMemory: false)
memcpy(passphrase.mutableItems, passphraseText.utf8String!,