From cc9a97f0cb14009409ad66c189402b6b50f873e2 Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 17 Oct 2018 11:29:34 +0200 Subject: OLMKit: Zero buffers out in all pickle & unpickle methods --- xcode/OLMKit/OLMOutboundGroupSession.m | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xcode/OLMKit/OLMOutboundGroupSession.m') diff --git a/xcode/OLMKit/OLMOutboundGroupSession.m b/xcode/OLMKit/OLMOutboundGroupSession.m index a3421fd..a0a7cc6 100644 --- a/xcode/OLMKit/OLMOutboundGroupSession.m +++ b/xcode/OLMKit/OLMOutboundGroupSession.m @@ -148,6 +148,7 @@ } NSMutableData *pickle = [serializedData dataUsingEncoding:NSUTF8StringEncoding].mutableCopy; size_t result = olm_unpickle_outbound_group_session(session, key.bytes, key.length, pickle.mutableBytes, pickle.length); + [pickle resetBytesInRange:NSMakeRange(0, pickle.length)]; if (result == olm_error()) { const char *olm_error = olm_outbound_group_session_last_error(session); NSString *errorString = [NSString stringWithUTF8String:olm_error]; @@ -174,6 +175,7 @@ return nil; } NSString *pickleString = [[NSString alloc] initWithData:pickled encoding:NSUTF8StringEncoding]; + [pickled resetBytesInRange:NSMakeRange(0, pickled.length)]; return pickleString; } -- cgit v1.2.3