diff options
Diffstat (limited to 'xcode/OLMKit/OLMSession.m')
-rw-r--r-- | xcode/OLMKit/OLMSession.m | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xcode/OLMKit/OLMSession.m b/xcode/OLMKit/OLMSession.m index 8c29113..fc58a08 100644 --- a/xcode/OLMKit/OLMSession.m +++ b/xcode/OLMKit/OLMSession.m @@ -309,6 +309,7 @@ } NSMutableData *pickle = [serializedData dataUsingEncoding:NSUTF8StringEncoding].mutableCopy; size_t result = olm_unpickle_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_session_last_error(_session); NSString *errorString = [NSString stringWithUTF8String:olm_error]; @@ -335,6 +336,7 @@ return nil; } NSString *pickleString = [[NSString alloc] initWithData:pickled encoding:NSUTF8StringEncoding]; + [pickled resetBytesInRange:NSMakeRange(0, pickled.length)]; return pickleString; } |