mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
linux(4): readlink should fail if bufzis <= 0.
MFC after: 2 weeks
This commit is contained in:
parent
b7df7b987e
commit
d6ccce0aa2
1 changed files with 6 additions and 0 deletions
|
|
@ -1042,6 +1042,9 @@ linux_readlink(struct thread *td, struct linux_readlink_args *args)
|
|||
char *name;
|
||||
int error;
|
||||
|
||||
if (args->count <= 0)
|
||||
return (EINVAL);
|
||||
|
||||
if (!LUSECONVPATH(td)) {
|
||||
return (kern_readlinkat(td, AT_FDCWD, args->name, UIO_USERSPACE,
|
||||
args->buf, UIO_USERSPACE, args->count));
|
||||
|
|
@ -1060,6 +1063,9 @@ linux_readlinkat(struct thread *td, struct linux_readlinkat_args *args)
|
|||
char *name;
|
||||
int error, dfd;
|
||||
|
||||
if (args->bufsiz <= 0)
|
||||
return (EINVAL);
|
||||
|
||||
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
|
||||
if (!LUSECONVPATH(td)) {
|
||||
return (kern_readlinkat(td, dfd, args->path, UIO_USERSPACE,
|
||||
|
|
|
|||
Loading…
Reference in a new issue