Skip to content

Commit

Permalink
Merge pull request #474 from haircommander/sast-fixes
Browse files Browse the repository at this point in the history
fix some issues flagged by SAST scan
  • Loading branch information
giuseppe authored Dec 14, 2023
2 parents 9d7eca4 + fad6bac commit a41bdfb
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 a41bdfb

Please sign in to comment.