aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/firejail/fs_bin.c6
-rw-r--r--src/firejail/fs_var.c2
-rw-r--r--src/lib/ldd_utils.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/firejail/fs_bin.c b/src/firejail/fs_bin.c
index 2b0b3003e..6228e9740 100644
--- a/src/firejail/fs_bin.c
+++ b/src/firejail/fs_bin.c
@@ -27,7 +27,7 @@
27 27
28static int prog_cnt = 0; 28static int prog_cnt = 0;
29 29
30static char *paths[] = { 30static const char * const paths[] = {
31 "/usr/local/bin", 31 "/usr/local/bin",
32 "/usr/bin", 32 "/usr/bin",
33 "/bin", 33 "/bin",
@@ -40,7 +40,7 @@ static char *paths[] = {
40}; 40};
41 41
42// return 1 if found, 0 if not found 42// return 1 if found, 0 if not found
43static char *check_dir_or_file(const char *name) { 43static const char *check_dir_or_file(const char *name) {
44 EUID_ASSERT(); 44 EUID_ASSERT();
45 assert(name); 45 assert(name);
46 struct stat s; 46 struct stat s;
@@ -160,7 +160,7 @@ static void duplicate(char *fname) {
160 else { 160 else {
161 // Find the standard directory (by looping through paths[]) 161 // Find the standard directory (by looping through paths[])
162 // where the filename fname is located 162 // where the filename fname is located
163 char *path = check_dir_or_file(fname); 163 const char *path = check_dir_or_file(fname);
164 if (!path) 164 if (!path)
165 return; 165 return;
166 if (asprintf(&full_path, "%s/%s", path, fname) == -1) 166 if (asprintf(&full_path, "%s/%s", path, fname) == -1)
diff --git a/src/firejail/fs_var.c b/src/firejail/fs_var.c
index 9523875d7..ad5ee6759 100644
--- a/src/firejail/fs_var.c
+++ b/src/firejail/fs_var.c
@@ -300,7 +300,7 @@ void fs_var_utmp(void) {
300 300
301 // read current utmp 301 // read current utmp
302 struct utmp *u; 302 struct utmp *u;
303 struct utmp u_boot; 303 struct utmp u_boot = {0};
304 setutent(); 304 setutent();
305 while ((u = getutent()) != NULL) { 305 while ((u = getutent()) != NULL) {
306 if (u->ut_type == BOOT_TIME) { 306 if (u->ut_type == BOOT_TIME) {
diff --git a/src/lib/ldd_utils.c b/src/lib/ldd_utils.c
index bc4f7cf9c..a50b759c3 100644
--- a/src/lib/ldd_utils.c
+++ b/src/lib/ldd_utils.c
@@ -47,7 +47,7 @@ int is_lib_64(const char *exe) {
47 if (fd < 0) 47 if (fd < 0)
48 return 0; 48 return 0;
49 49
50 unsigned char buf[EI_NIDENT]; 50 unsigned char buf[EI_NIDENT] = {0};
51 ssize_t len = 0; 51 ssize_t len = 0;
52 while (len < EI_NIDENT) { 52 while (len < EI_NIDENT) {
53 ssize_t sz = read(fd, buf + len, EI_NIDENT - len); 53 ssize_t sz = read(fd, buf + len, EI_NIDENT - len);