Skip to content

Suggestion for improvements#8

Open
Daksh-10 wants to merge 1 commit intocanonical:improvefrom
Daksh-10:improve
Open

Suggestion for improvements#8
Daksh-10 wants to merge 1 commit intocanonical:improvefrom
Daksh-10:improve

Conversation

@Daksh-10
Copy link
Copy Markdown

No description provided.

Signed-off-by: Daksh <dakshkaushik20040126@gmail.com>
Comment thread main.c

struct sock_fprog prog_allow = { 0 };
struct sock_fprog prog_allow = {0};
struct sc_seccomp_file_header hdr = {0};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! Initializing the sc_seccomp_file_header struct with = {0} ensures all fields start with known values.

Comment thread main.c

const char *profile_path = argv[1];
FILE *file = sc_must_read_and_validate_header_from_file(profile_path, &hdr);
FILE *file = sc_must_read_and_validate_header_from_file(profile_path, &hdr);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the implementation of sc_must_read_and_validate_header_from_file()?
Does it actually validate the header magic bytes?
Does it validate the version?
Does it handle partial reads correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants