svn commit: r297694 - head/sys/security/audit
Pedro F. Giffuni
pfg at FreeBSD.org
Fri Apr 8 03:26:22 UTC 2016
Author: pfg
Date: Fri Apr 8 03:26:21 2016
New Revision: 297694
URL: https://svnweb.freebsd.org/changeset/base/297694
Log:
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.
Modified:
head/sys/security/audit/audit_syscalls.c
Modified: head/sys/security/audit/audit_syscalls.c
==============================================================================
--- head/sys/security/audit/audit_syscalls.c Fri Apr 8 01:57:40 2016 (r297693)
+++ head/sys/security/audit/audit_syscalls.c Fri Apr 8 03:26:21 2016 (r297694)
@@ -303,8 +303,8 @@ sys_auditon(struct thread *td, struct au
(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;
More information about the svn-src-head
mailing list