diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-10-22 11:08:52 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-10-22 11:08:52 +0000 |
commit | 705746618befcb043232cb6bc8fb61708da3974e (patch) | |
tree | d20ab32b8079625bc1ce377381ad48510befc652 /sys | |
parent | 730226a1f3678a2ade4519189bd2db3b82f3186b (diff) | |
download | FreeBSD-src-705746618befcb043232cb6bc8fb61708da3974e.zip FreeBSD-src-705746618befcb043232cb6bc8fb61708da3974e.tar.gz |
In the MAC label zone destructor, assert that the label is only
destroyed in an initialized state.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/security/mac/mac_label.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/security/mac/mac_label.c b/sys/security/mac/mac_label.c index 19bd5b0..f6d92ef 100644 --- a/sys/security/mac/mac_label.c +++ b/sys/security/mac/mac_label.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2003 Networks Associates Technology, Inc. + * Copyright (c) 2003-2004 Networks Associates Technology, Inc. * All rights reserved. * * This software was developed for the FreeBSD Project in part by Network @@ -76,6 +76,8 @@ mac_labelzone_dtor(void *mem, int size, void *arg) KASSERT(size == sizeof(*label), ("mac_labelzone_dtor: wrong size\n")); label = mem; + KASSERT(label->l_flags & MAC_FLAG_INITIALIZED, + ("mac_labelzone_dtor: label not initialized")); #ifdef DIAGNOSTIC bzero(label, sizeof(*label)); #else |