Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix passing of argument with incompatible pointer type to fts_open() #273

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/startup.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ enum selint_error load_access_vectors_kernel(const char *av_path)
}

enum selint_error r = SELINT_PARSE_ERROR;
const char *paths[2] = { av_path, NULL };
char *av_path_copy = xstrdup(av_path);
dburgener marked this conversation as resolved.
Show resolved Hide resolved
char *const paths[2] = { av_path_copy, NULL };

IGNORE_CONST_DISCARD_BEGIN;
FTS *ftsp = fts_open(paths, FTS_PHYSICAL, NULL);
IGNORE_CONST_DISCARD_END;

FTSENT *file = fts_read(ftsp);

Expand All @@ -66,6 +65,7 @@ IGNORE_CONST_DISCARD_END;
file = fts_read(ftsp);
}
fts_close(ftsp);
free(av_path_copy);

return r;
}
Expand Down Expand Up @@ -221,12 +221,10 @@ static int mark_transform_interfaces_one_file(const struct policy_node *ast) {

enum selint_error load_devel_headers(struct policy_file_list *context_files)
{
const char *header_loc = "/usr/share/selinux/devel";
const char *paths[2] = {header_loc, 0};
char header_loc[] = "/usr/share/selinux/devel";
char *const paths[2] = { header_loc, NULL };

IGNORE_CONST_DISCARD_BEGIN;
FTS *ftsp = fts_open(paths, FTS_PHYSICAL | FTS_NOSTAT, NULL);
IGNORE_CONST_DISCARD_END;

FTSENT *file = fts_read(ftsp);
while (file) {
Expand Down