diff options
-rw-r--r-- | sys/kern/kern_lockf.c | 7 | ||||
-rw-r--r-- | sys/kern/vfs_extattr.c | 1 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 1 |
3 files changed, 2 insertions, 7 deletions
diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c index ae2ebe9..47f470c 100644 --- a/sys/kern/kern_lockf.c +++ b/sys/kern/kern_lockf.c @@ -103,7 +103,7 @@ lf_advlock(ap, head, size) { register struct flock *fl = ap->a_fl; register struct lockf *lock; - off_t start, end; + off_t start, end, oadd; int error; /* @@ -121,7 +121,6 @@ lf_advlock(ap, head, size) break; case SEEK_END: - /* 'size' is always >= 0 */ if ((fl->l_start > 0 && size > OFF_MAX - fl->l_start) || (fl->l_start < 0 && size + fl->l_start > OFF_MAX)) return (EOVERFLOW); @@ -143,9 +142,7 @@ lf_advlock(ap, head, size) } else if (fl->l_len == 0) end = -1; else { - off_t oadd = fl->l_len - 1; - - /* 'oadd' and 'start' are >= 0 */ + oadd = fl->l_len - 1; if (oadd > OFF_MAX - start) return (EOVERFLOW); end = start + oadd; diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index f6321a2..164d0f4 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -1640,7 +1640,6 @@ lseek(p, uap) error = VOP_GETATTR(vp, &vattr, cred, p); if (error) return (error); - /* 'vattr.va_size' is always >= 0 */ if (noneg && ((offset > 0 && vattr.va_size > OFF_MAX - offset) || (offset < 0 && vattr.va_size + offset > OFF_MAX))) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index f6321a2..164d0f4 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1640,7 +1640,6 @@ lseek(p, uap) error = VOP_GETATTR(vp, &vattr, cred, p); if (error) return (error); - /* 'vattr.va_size' is always >= 0 */ if (noneg && ((offset > 0 && vattr.va_size > OFF_MAX - offset) || (offset < 0 && vattr.va_size + offset > OFF_MAX))) |