diff options
author | Renaud Manus <Renaud.Manus@Sun.COM> | 2009-02-02 14:49:51 +0000 |
---|---|---|
committer | Renaud Manus <Renaud.Manus@Sun.COM> | 2009-02-02 14:49:51 +0000 |
commit | 57841ad7c4da76238b3e15b3f642e30e046a5256 (patch) | |
tree | 02791de0a2cbf6b082c5a07d2ef16a2b5ed1a92e /usr/src/lib/libsec/common/aclutils.c | |
parent | 7a8a68f5e3efbaec1a375c2d50bd20b566631755 (diff) | |
download | illumos-joyent-57841ad7c4da76238b3e15b3f642e30e046a5256.tar.gz |
6787376 chmod core dump by SIGBUS while removing ACE recursively
Diffstat (limited to 'usr/src/lib/libsec/common/aclutils.c')
-rw-r--r-- | usr/src/lib/libsec/common/aclutils.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/lib/libsec/common/aclutils.c b/usr/src/lib/libsec/common/aclutils.c index f6558f3d08..2b79d0c649 100644 --- a/usr/src/lib/libsec/common/aclutils.c +++ b/usr/src/lib/libsec/common/aclutils.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -509,11 +509,18 @@ acl_removeentries(acl_t *acl, acl_t *removeacl, int start_slot, int flag) match = acl_match(acl_entry, remove_entry); if (match == 0) { found++; + + /* avoid memmove if last entry */ + if (acl->acl_cnt == (j + 1)) { + acl->acl_cnt--; + break; + } + start = (char *)acl_entry + acl->acl_entry_size; (void) memmove(acl_entry, start, acl->acl_entry_size * - acl->acl_cnt-- - (j + 1)); + (acl->acl_cnt-- - (j + 1))); if (flag == ACL_REMOVE_FIRST) break; |