diff options
-rw-r--r-- | src/firejail/fs_whitelist.c | 4 | ||||
-rw-r--r-- | src/firejail/util.c | 2 | ||||
-rw-r--r-- | src/lib/libnetlink.c | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c index 073e247dc..2751a8c71 100644 --- a/src/firejail/fs_whitelist.c +++ b/src/firejail/fs_whitelist.c | |||
@@ -61,7 +61,7 @@ static void whitelist_path(ProfileEntry *entry) { | |||
61 | char *path = entry->data + 10; | 61 | char *path = entry->data + 10; |
62 | assert(path); | 62 | assert(path); |
63 | const char *fname; | 63 | const char *fname; |
64 | char *wfile; | 64 | char *wfile = NULL; |
65 | 65 | ||
66 | if (entry->home_dir) { | 66 | if (entry->home_dir) { |
67 | fname = path + strlen(cfg.homedir); | 67 | fname = path + strlen(cfg.homedir); |
@@ -86,7 +86,7 @@ static void whitelist_path(ProfileEntry *entry) { | |||
86 | 86 | ||
87 | // check if the file exists | 87 | // check if the file exists |
88 | struct stat s; | 88 | struct stat s; |
89 | if (stat(wfile, &s) == 0) { | 89 | if (wfile && stat(wfile, &s) == 0) { |
90 | if (arg_debug) | 90 | if (arg_debug) |
91 | printf("Whitelisting %s\n", path); | 91 | printf("Whitelisting %s\n", path); |
92 | } | 92 | } |
diff --git a/src/firejail/util.c b/src/firejail/util.c index d2e6c2799..89d0697fd 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -258,7 +258,7 @@ char *line_remove_spaces(const char *buf) { | |||
258 | } | 258 | } |
259 | 259 | ||
260 | // strip last blank character if any | 260 | // strip last blank character if any |
261 | if (*(ptr2 - 1) == ' ') | 261 | if (ptr2 > rv && *(ptr2 - 1) == ' ') |
262 | --ptr2; | 262 | --ptr2; |
263 | *ptr2 = '\0'; | 263 | *ptr2 = '\0'; |
264 | // if (arg_debug) | 264 | // if (arg_debug) |
diff --git a/src/lib/libnetlink.c b/src/lib/libnetlink.c index fddbc209d..07457eefe 100644 --- a/src/lib/libnetlink.c +++ b/src/lib/libnetlink.c | |||
@@ -626,7 +626,8 @@ printf("\tdata length: %d\n", alen); | |||
626 | rta = NLMSG_TAIL(n); | 626 | rta = NLMSG_TAIL(n); |
627 | rta->rta_type = type; | 627 | rta->rta_type = type; |
628 | rta->rta_len = len; | 628 | rta->rta_len = len; |
629 | memcpy(RTA_DATA(rta), data, alen); | 629 | if (data) |
630 | memcpy(RTA_DATA(rta), data, alen); | ||
630 | n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len); | 631 | n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len); |
631 | return 0; | 632 | return 0; |
632 | } | 633 | } |