mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-26 20:12:44 +00:00
kern___realpathat(): do not copyout past end of string
Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47739
This commit is contained in:
parent
31784ee1e3
commit
67218bcea8
@ -3290,7 +3290,7 @@ kern___realpathat(struct thread *td, int fd, const char *path, char *buf,
|
||||
&freebuf, &size);
|
||||
}
|
||||
if (error == 0) {
|
||||
error = copyout(retbuf, buf, size);
|
||||
error = copyout(retbuf, buf, min(strlen(retbuf) + 1, size));
|
||||
free(freebuf, M_TEMP);
|
||||
}
|
||||
out:
|
||||
|
Loading…
Reference in New Issue
Block a user