From b20631da6e18b8d78ed1a55f2e254772e7ec7f3f Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 8 Nov 2017 13:23:06 +0100 Subject: [PATCH] masked value should not be cached since it might include references --- MacPass/MPAutotypeContext.m | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/MacPass/MPAutotypeContext.m b/MacPass/MPAutotypeContext.m index 2603cf31..2ae6d90f 100644 --- a/MacPass/MPAutotypeContext.m +++ b/MacPass/MPAutotypeContext.m @@ -26,7 +26,6 @@ @interface MPAutotypeContext () { NSString *_evaluatedCommand; - NSString *_maskedEvaluatedCommand; } @end @@ -71,13 +70,10 @@ } - (NSString *)maskedEvaluatedCommand { - if(!_maskedEvaluatedCommand) { - NSString *passwordPlaceholder = [NSString stringWithFormat:@"{%@}",kKPKPasswordKey]; - NSString *normalized = self.normalizedCommand; - NSString *masked = [normalized stringByReplacingOccurrencesOfString:passwordPlaceholder withString:@"•••••" options:NSCaseInsensitiveSearch range:NSMakeRange(0, normalized.length)]; - _maskedEvaluatedCommand = [[masked kpk_finalValueForEntry:self.entry] copy]; - } - return _maskedEvaluatedCommand; + NSString *passwordPlaceholder = [NSString stringWithFormat:@"{%@}",kKPKPasswordKey]; + NSString *normalized = self.normalizedCommand; + NSString *masked = [normalized stringByReplacingOccurrencesOfString:passwordPlaceholder withString:@"•••" options:NSCaseInsensitiveSearch range:NSMakeRange(0, normalized.length)]; + return [[masked kpk_finalValueForEntry:self.entry] copy]; } - (NSString *)description {