From e74d034db4850ab6746e39f532f64578da91ad67 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 18 Jun 2022 15:28:21 +0000 Subject: [PATCH] [iOS] Fix missing 0 byte after passphrase FossilOrigin-Name: b57405c1d07a52c27807f6fe19eff1b1277663f051690a3a3336dc626c6f4825 --- iOS/ShowDetailsController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOS/ShowDetailsController.swift b/iOS/ShowDetailsController.swift index 04ff3df..a0dfb20 100644 --- a/iOS/ShowDetailsController.swift +++ b/iOS/ShowDetailsController.swift @@ -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!,