Fix leaks and a possible buffer overrun

This commit is contained in:
rfm 2024-11-17 12:55:55 +00:00
parent 5b46efa8cd
commit 0fb9739f21
4 changed files with 14 additions and 5 deletions

View file

@ -1770,7 +1770,13 @@ NSDictionary *locale)
if (-1 == prec)
{
len = strlen(str); // Number of bytes to convert.
/* Find end of string, within the specified limit.
*/
len = 0;
while (str[len] != '\0' && len < width)
{
len++;
}
blen = len; // Size of unichar output buffer.
}
else