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 some issues flagged by SAST scan #474

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/conn_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ static char *bind_unix_socket(char *socket_relative_name, int sock_type, mode_t
int socket_fd = -1;

/* get the parent_dir of the socket. We'll use this to get the location of the socket. */
char *parent_dir = socket_parent_dir(use_full_attach_path, max_socket_path_len());
_cleanup_free_ char *parent_dir = socket_parent_dir(use_full_attach_path, max_socket_path_len());

/*
* To be able to access the location of the attach socket, without first creating the attach socket
Expand Down
4 changes: 2 additions & 2 deletions src/ctr_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ static void drain_log_buffers(stdpipe_t pipe)
{
/* We pass a single byte buffer because write_to_logs expects that there is one
byte of capacity beyond the buflen that we specify */
char buf;
write_to_logs(pipe, &buf, 0);
char buf[1];
write_to_logs(pipe, buf, 0);
}

static bool read_stdio(int fd, stdpipe_t pipe, gboolean *eof)
Expand Down
Loading