mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 15:00:12 +00:00
libacl: Fix problems found by static analysis
Several static analysis tools have identified various problems: - missing checks to ensure *alloc was successful (infer) To resolve the above problems: - add checks to ensure *alloc was successful before using the memory This commit is a reorganization of commits developed by Pat Riehecky, who ran the static analysis tools and developed the fixes. Change-Id: I48e053e73131c3f86928a4658dbc69e56abd2b20 Reviewed-on: https://gerrit.openafs.org/14683 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
This commit is contained in:
parent
56d5ee3800
commit
8b1b708e5f
@ -186,6 +186,9 @@ acl_Externalize_pr(int (*func)(idlist *ids, namelist *names), struct acl_accessL
|
||||
acl_NewExternalACL(acl->total, elist);
|
||||
nextc = *elist;
|
||||
lids.idlist_val = calloc(ACL_MAXENTRIES, sizeof(afs_int32));
|
||||
if (lids.idlist_val == NULL) {
|
||||
return ENOMEM;
|
||||
}
|
||||
lids.idlist_len = acl->total;
|
||||
lnames.namelist_len = 0;
|
||||
lnames.namelist_val = (prname *) 0;
|
||||
|
Loading…
Reference in New Issue
Block a user