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:
Frans Kaashoek 2021-09-01 07:29:12 -04:00
parent bf4816c9c6
commit 8ca56e9e0b

View file

@ -33,6 +33,9 @@ memmove(void *dst, const void *src, uint n)
const char *s;
char *d;
if(n == 0)
return dst;
s = src;
d = dst;
if(s < d && s + n > d){