Skip to content

Commit

Permalink
fix some issues flagged by SAST scan
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hunt <[email protected]>
  • Loading branch information
haircommander committed Dec 13, 2023
1 parent 9d7eca4 commit fad6bac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit fad6bac

Please sign in to comment.