mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Fix possible memory corruption in string handling
This commit is contained in:
parent
49ba7d1ed1
commit
a377a86094
3 changed files with 16 additions and 8 deletions
|
@ -487,13 +487,13 @@ UTextInitWithNSString(UText *txt, NSString *str)
|
|||
- (void) replaceCharactersInRange: (NSRange)r
|
||||
withString: (NSString*)aString
|
||||
{
|
||||
NSUInteger size = [aString length];
|
||||
NSUInteger length = [aString length];
|
||||
UErrorCode status = 0;
|
||||
|
||||
TEMP_BUFFER(buffer, size);
|
||||
[aString getCharacters: buffer range: NSMakeRange(0, size)];
|
||||
TEMP_BUFFER(buffer, length);
|
||||
[aString getCharacters: buffer range: NSMakeRange(0, length)];
|
||||
|
||||
utext_replace(&txt, r.location, r.location + r.length, buffer, size, &status);
|
||||
utext_replace(&txt, r.location, r.location + r.length, buffer, length, &status);
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue