mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
libapparmor: Fix segfault when loading policy cache files
qsort()'s _size_ parameter is used to indicate the size of the elements
in the _base_ array parameter. Adjust the third argument to qsort() to
indicate that we're dealing with an array of struct dirent pointers
rather than an array of struct dirent.
PR: https://gitlab.com/apparmor/apparmor/merge_requests/348
(cherry picked from commit 8b21871820
)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
68eb3be2ae
commit
01aec04bd6
1 changed files with 1 additions and 1 deletions
|
@ -366,7 +366,7 @@ static ssize_t readdirfd(int dirfd, struct dirent ***out,
|
|||
}
|
||||
|
||||
if (dircmp)
|
||||
qsort(dents, n, sizeof(*dent), (int (*)(const void *, const void *))dircmp);
|
||||
qsort(dents, n, sizeof(struct dirent *), (int (*)(const void *, const void *))dircmp);
|
||||
|
||||
*out = dents;
|
||||
closedir(dir);
|
||||
|
|
Loading…
Add table
Reference in a new issue