aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Reiner Herrmann <reiner@reiner-h.de>2022-07-27 21:12:58 +0200
committerLibravatar Reiner Herrmann <reiner@reiner-h.de>2022-07-30 10:48:33 +0200
commiteb20f52ef570196e12e715e2a8c002feb103e448 (patch)
treedda8169cc4a48c40265973034e31bcf43f461c0f /src
parentzero-initialize two variables (diff)
downloadfirejail-eb20f52ef570196e12e715e2a8c002feb103e448.tar.gz
firejail-eb20f52ef570196e12e715e2a8c002feb103e448.tar.zst
firejail-eb20f52ef570196e12e715e2a8c002feb103e448.zip
Make list of paths const to fix a false positive of gcc analyzer
Diffstat (limited to 'src')
-rw-r--r--src/firejail/fs_bin.c6
1 files changed, 3 insertions, 3 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)