iOS: Get the length from the generator
This fixes reading over the buffer if it is not zero terminated. Fortunately, this was almost always the case by pure luck.
This commit is contained in:
parent
8de675d32c
commit
d414924126
1 changed files with 5 additions and 4 deletions
|
@ -200,10 +200,11 @@ clearNSMutableString(NSMutableString *string)
|
||||||
free(passphrase);
|
free(passphrase);
|
||||||
}
|
}
|
||||||
|
|
||||||
NSMutableString *password = [NSMutableString
|
NSMutableString *password = [[[NSMutableString alloc]
|
||||||
stringWithUTF8String: (char *)generator.output];
|
initWithBytes: (char *)generator.output
|
||||||
of_explicit_memset(generator.output, 0,
|
length: generator.length
|
||||||
strlen((char *)generator.output));
|
encoding: NSUTF8StringEncoding] autorelease];
|
||||||
|
of_explicit_memset(generator.output, 0, generator.length);
|
||||||
|
|
||||||
dispatch_sync(dispatch_get_main_queue(), ^ {
|
dispatch_sync(dispatch_get_main_queue(), ^ {
|
||||||
activityController.view.hidden = YES;
|
activityController.view.hidden = YES;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue