Skip to content

Commit a41bdfb

Browse files
authored
Merge pull request #474 from haircommander/sast-fixes
fix some issues flagged by SAST scan
2 parents 9d7eca4 + fad6bac commit a41bdfb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/conn_sock.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static char *bind_unix_socket(char *socket_relative_name, int sock_type, mode_t
263263
int socket_fd = -1;
264264

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

268268
/*
269269
* To be able to access the location of the attach socket, without first creating the attach socket

src/ctr_stdio.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ static void drain_log_buffers(stdpipe_t pipe)
106106
{
107107
/* We pass a single byte buffer because write_to_logs expects that there is one
108108
byte of capacity beyond the buflen that we specify */
109-
char buf;
110-
write_to_logs(pipe, &buf, 0);
109+
char buf[1];
110+
write_to_logs(pipe, buf, 0);
111111
}
112112

113113
static bool read_stdio(int fd, stdpipe_t pipe, gboolean *eof)

0 commit comments

Comments
 (0)