Browse Source

avoid overflow in memsetptr

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@838 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 10 years ago
parent
commit
95e9516102
  1. 5
      processor/head.m4

5
processor/head.m4

@ -106,10 +106,13 @@ static void *memsetptr(void *mem, void *content, size_t n)
{
void **p = (void **) mem;
void **end = (char *) mem + n;
while (p < end) {
while (p < end - sizeof(content)) {
*p = content;
p += sizeof(content);
}
if (p < end) {
memset(p, -1, end - p);
}
return mem;
}
')

Loading…
Cancel
Save