aboutsummaryrefslogtreecommitdiff
path: root/sys/security/mac
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2018-08-01 03:46:07 +0000
committerMark Johnston <markj@FreeBSD.org>2018-08-01 03:46:07 +0000
commit6324de037cb6ee621855384588e11d603c931d46 (patch)
tree83314c53bb26ce1f0e9d19b9dfd623d83a65388b /sys/security/mac
parent3c09eaee95308c24632df1e978594edf46afa518 (diff)
downloadsrc-6324de037cb6ee621855384588e11d603c931d46.tar.gz
src-6324de037cb6ee621855384588e11d603c931d46.zip
Notes
Diffstat (limited to 'sys/security/mac')
-rw-r--r--sys/security/mac/mac_framework.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c
index f56627c7ea0e..ecccca03e99b 100644
--- a/sys/security/mac/mac_framework.c
+++ b/sys/security/mac/mac_framework.c
@@ -586,7 +586,9 @@ int
mac_check_structmac_consistent(struct mac *mac)
{
- if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN)
+ /* Require that labels have a non-zero length. */
+ if (mac->m_buflen > MAC_MAX_LABEL_BUF_LEN ||
+ mac->m_buflen <= sizeof(""))
return (EINVAL);
return (0);