Skip to content

Commit

Permalink
acl: fix crash when cons->ACL_lists[acl] is NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz authored and joergsteffens committed Sep 22, 2016
1 parent 9735007 commit 70cca38
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/dird/ua_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,28 +276,32 @@ bool UAContext::acl_no_restrictions(int acl)
return true;
}

for (int i = 0; i < cons->ACL_lists[acl]->size(); i++) {
list_value = (char *)cons->ACL_lists[acl]->get(i);
if (cons->ACL_lists[acl]) {
for (int i = 0; i < cons->ACL_lists[acl]->size(); i++) {
list_value = (char *)cons->ACL_lists[acl]->get(i);

if (*list_value == '!') {
return false;
}
if (*list_value == '!') {
return false;
}

if (bstrcasecmp("*all*", list_value)) {
return true;
if (bstrcasecmp("*all*", list_value)) {
return true;
}
}
}

foreach_alist(profile, cons->profiles) {
for (int i = 0; i < profile->ACL_lists[acl]->size(); i++) {
list_value = (char *)profile->ACL_lists[acl]->get(i);
if (profile->ACL_lists[acl]) {
for (int i = 0; i < profile->ACL_lists[acl]->size(); i++) {
list_value = (char *)profile->ACL_lists[acl]->get(i);

if (*list_value == '!') {
return false;
}
if (*list_value == '!') {
return false;
}

if (bstrcasecmp("*all*", list_value)) {
return true;
if (bstrcasecmp("*all*", list_value)) {
return true;
}
}
}
}
Expand Down

0 comments on commit 70cca38

Please sign in to comment.