Fix (static) buffer overflow bug. The dest buffer is of size MAXPATHLEN,
so dest[MAXPATHLEN] falls outside the buffer. This bug corrupted arenas[0] defined in libc's malloc.c on PowerPC when kldxref is shared, which triggered a delayed SIGSERV.
This commit is contained in:
parent
bc6ab54808
commit
5fae7020fe
@ -260,7 +260,7 @@ maketempfile(char *dest, const char *root)
|
||||
int fd;
|
||||
|
||||
strncpy(dest, root, MAXPATHLEN - 1);
|
||||
dest[MAXPATHLEN] = '\0';
|
||||
dest[MAXPATHLEN-1] = '\0';
|
||||
|
||||
if ((p = strrchr(dest, '/')) != 0)
|
||||
p++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user