changer memcpy to memmove

This commit is contained in:
Richard Frith-Macdonald 2018-02-03 10:11:30 +00:00
parent e69450400a
commit 8a66507f29
2 changed files with 9 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2018-01-26 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSFTPURLHandle.m: change memcpy to memmove to avoid possible
problems with overlapping source and destination areas.
2018-02-01 Fred Kiefer <fredkiefer@gmx.de>
* Source/GSFormat.m: Call va_end with the correct parameter.

View file

@ -321,7 +321,7 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
len -= 3;
if (len - i > 0)
{
memcpy(ptr, &ptr[3], len - i);
memmove(ptr, &ptr[3], len - i);
}
i--; // Try again.
}
@ -336,7 +336,7 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
len--;
if (len - i > 0)
{
memcpy(ptr, &ptr[1], len - i);
memmove(ptr, &ptr[1], len - i);
}
}
else
@ -348,7 +348,7 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
len -= 2;
if (len - i > 0)
{
memcpy(ptr, &ptr[2], len - i);
memmove(ptr, &ptr[2], len - i);
}
i--; // Try again from here.
}
@ -418,7 +418,7 @@ NSString * const GSTelnetTextKey = @"GSTelnetTextKey";
pos -= s;
if (len > 0)
{
memcpy(ptr, &ptr[s], len);
memmove(ptr, &ptr[s], len);
}
}
[ibuf setLength: len];