diff options
author | John Mullee <jmullee@yahoo.com> | 2017-06-29 22:50:47 +0100 |
---|---|---|
committer | John Mullee <jmullee@yahoo.com> | 2017-06-29 22:50:47 +0100 |
commit | a33c76cf057b56b54512f3fa7edc805e0eeea222 (patch) | |
tree | a49ad3f9971d1cfb66e76cffde0b86815ed1e1ba /src | |
parent | geary typo (diff) | |
download | firejail-a33c76cf057b56b54512f3fa7edc805e0eeea222.tar.gz firejail-a33c76cf057b56b54512f3fa7edc805e0eeea222.tar.zst firejail-a33c76cf057b56b54512f3fa7edc805e0eeea222.zip |
fix empty-string assignment
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/fs_whitelist.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c index 3403c57a7..480df1766 100644 --- a/src/firejail/fs_whitelist.c +++ b/src/firejail/fs_whitelist.c | |||
@@ -34,6 +34,7 @@ static char *dentry[] = { | |||
34 | NULL | 34 | NULL |
35 | }; | 35 | }; |
36 | 36 | ||
37 | #define EMPTY_STRING ("") | ||
37 | #define MAXBUF 4098 | 38 | #define MAXBUF 4098 |
38 | static char *resolve_downloads(int nowhitelist_flag) { | 39 | static char *resolve_downloads(int nowhitelist_flag) { |
39 | char *fname; | 40 | char *fname; |
@@ -359,7 +360,7 @@ void fs_whitelist(void) { | |||
359 | fprintf(stderr, "*** \tPlease create a proper Downloads directory for your application.\n"); | 360 | fprintf(stderr, "*** \tPlease create a proper Downloads directory for your application.\n"); |
360 | fprintf(stderr, "***\n"); | 361 | fprintf(stderr, "***\n"); |
361 | } | 362 | } |
362 | *entry->data = '\0'; | 363 | entry->data = EMPTY_STRING; |
363 | continue; | 364 | continue; |
364 | } | 365 | } |
365 | } | 366 | } |
@@ -413,7 +414,7 @@ void fs_whitelist(void) { | |||
413 | opt_dir = 1; | 414 | opt_dir = 1; |
414 | } | 415 | } |
415 | 416 | ||
416 | *entry->data = '\0'; | 417 | entry->data = EMPTY_STRING; |
417 | continue; | 418 | continue; |
418 | } | 419 | } |
419 | 420 | ||
@@ -429,7 +430,7 @@ void fs_whitelist(void) { | |||
429 | errExit("failed increasing memory for nowhitelist entries"); | 430 | errExit("failed increasing memory for nowhitelist entries"); |
430 | } | 431 | } |
431 | nowhitelist[nowhitelist_c++] = fname; | 432 | nowhitelist[nowhitelist_c++] = fname; |
432 | *entry->data = 0; | 433 | entry->data = EMPTY_STRING; |
433 | continue; | 434 | continue; |
434 | } | 435 | } |
435 | 436 | ||
@@ -440,7 +441,7 @@ void fs_whitelist(void) { | |||
440 | if (arg_private) { | 441 | if (arg_private) { |
441 | fwarning("\"%s\" disabled by --private\n", entry->data); | 442 | fwarning("\"%s\" disabled by --private\n", entry->data); |
442 | 443 | ||
443 | *entry->data = '\0'; | 444 | entry->data = EMPTY_STRING; |
444 | continue; | 445 | continue; |
445 | } | 446 | } |
446 | 447 | ||
@@ -540,7 +541,7 @@ void fs_whitelist(void) { | |||
540 | if (found) { | 541 | if (found) { |
541 | if (arg_debug || arg_debug_whitelists) | 542 | if (arg_debug || arg_debug_whitelists) |
542 | printf("Skip nowhitelisted path %s\n", fname); | 543 | printf("Skip nowhitelisted path %s\n", fname); |
543 | *entry->data = 0; | 544 | entry->data = EMPTY_STRING; |
544 | free(fname); | 545 | free(fname); |
545 | continue; | 546 | continue; |
546 | } | 547 | } |