Rearrange the kern_getcwd() procedure to return the base of the string
authorMatthew Dillon <dillon@dragonflybsd.org>
Sat, 5 Jun 2004 16:34:07 +0000 (16:34 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sat, 5 Jun 2004 16:34:07 +0000 (16:34 +0000)
commit02680f1bd365bb65804f03970f38a47541b2df05
treeff484b5157b6a437e564121de5ba180de9e0c859
parent22897853052b6167ef315d8134d1e9d225734bd0
Rearrange the kern_getcwd() procedure to return the base of the string
rather then relocating the string.

Also fix two bugs: (1) the original bcopy was copying data beyond the end of
the buffer ([bp, bp+buflen] exceeds the buffer), and (2), the uap->buflen
checks must be made in __getcwd(), before the kernel tries to malloc() space.
sys/checkpt/support.c
sys/kern/vfs_cache.c
sys/sys/kern_syscall.h