Coverity ID 545 falsely classified this as a NULL dereferencing bug.
By putting the loop of walking the list of aces more naturely not using
additional counters, it becomes much more obvious that it is not entered
when dir_ace == NULL.
The same modifications are done for the file_ace loop.
Michael
(This used to be commit
6dab6cf0647d7db01e5e472f8b5cf21395b7dbf0)
{
canon_ace *ace;
enum security_ace_type nt_acl_type;
- int i;
if (nt4_compatible_acls() && dir_ace) {
/*
* Create the NT ACE list from the canonical ace lists.
*/
- ace = file_ace;
-
- for (i = 0; i < num_acls; i++, ace = ace->next) {
+ for (ace = file_ace; ace != NULL; ace = ace->next) {
SEC_ACCESS acc;
acc = map_canon_ace_perms(SNUM(conn),
acc, 0);
}
- ace = dir_ace;
-
- for (i = 0; i < num_def_acls; i++, ace = ace->next) {
+ for (ace = dir_ace; ace != NULL; ace = ace->next) {
SEC_ACCESS acc;
acc = map_canon_ace_perms(SNUM(conn),