memmove(dst, src, 0) leads to overflow in while(n-- > 0)
as n
is uint64 (thanks
Matúš Jókay <matus.jokay@stuba.sk>)
This commit is contained in:
parent
bf4816c9c6
commit
8ca56e9e0b
|
@ -33,6 +33,9 @@ memmove(void *dst, const void *src, uint n)
|
||||||
const char *s;
|
const char *s;
|
||||||
char *d;
|
char *d;
|
||||||
|
|
||||||
|
if(n == 0)
|
||||||
|
return dst;
|
||||||
|
|
||||||
s = src;
|
s = src;
|
||||||
d = dst;
|
d = dst;
|
||||||
if(s < d && s + n > d){
|
if(s < d && s + n > d){
|
||||||
|
|
Loading…
Reference in a new issue