diff options
author | pfg <pfg@FreeBSD.org> | 2016-04-08 03:26:21 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-04-08 03:26:21 +0000 |
commit | 99e1acfb71cd0afb9426daa85e3e274c091a9bb0 (patch) | |
tree | bfb1f35bd80a2b2b617d0e8e0a666fa55c1b1b45 /sys/security/audit | |
parent | b11db0106389f678ff146b18f3526adb1b9675cd (diff) | |
download | FreeBSD-src-99e1acfb71cd0afb9426daa85e3e274c091a9bb0.zip FreeBSD-src-99e1acfb71cd0afb9426daa85e3e274c091a9bb0.tar.gz |
audit(8): leave unsigned comparison for last.
aq64_minfree is unsigned so comparing to find out if it is less
than zero is a nonsense. Move the comparison to the last position
as we don't want to spend time if any of the others triggers first.
hile it would be tempting to just remove it, it may be important to
keep it for portability with platforms where may be signed(?) or
in case we may want to change it in the future.
Diffstat (limited to 'sys/security/audit')
-rw-r--r-- | sys/security/audit/audit_syscalls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/security/audit/audit_syscalls.c b/sys/security/audit/audit_syscalls.c index 90d811d..73411a4 100644 --- a/sys/security/audit/audit_syscalls.c +++ b/sys/security/audit/audit_syscalls.c @@ -303,8 +303,8 @@ sys_auditon(struct thread *td, struct auditon_args *uap) (udata.au_qctrl64.aq64_lowater >= udata.au_qctrl.aq_hiwater) || (udata.au_qctrl64.aq64_bufsz > AQ_MAXBUFSZ) || - (udata.au_qctrl64.aq64_minfree < 0) || - (udata.au_qctrl64.aq64_minfree > 100)) + (udata.au_qctrl64.aq64_minfree > 100) || + (udata.au_qctrl64.aq64_minfree < 0)) return (EINVAL); audit_qctrl.aq_hiwater = (int)udata.au_qctrl64.aq64_hiwater; |