aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-06-30 10:16:05 -0400
committerLibravatar GitHub <noreply@github.com>2017-06-30 10:16:05 -0400
commitcfd333b216be971b0b45ee0dbd20aee63c27f6f4 (patch)
tree8fc6b0c083a5f4cb08e90debdb135b93899c852b
parentLiferea profile (diff)
parentfix empty-string assignment (diff)
downloadfirejail-cfd333b216be971b0b45ee0dbd20aee63c27f6f4.tar.gz
firejail-cfd333b216be971b0b45ee0dbd20aee63c27f6f4.tar.zst
firejail-cfd333b216be971b0b45ee0dbd20aee63c27f6f4.zip
Merge pull request #1358 from jmullee/master
fix empty-string assignment
-rw-r--r--src/firejail/fs_whitelist.c11
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
38static char *resolve_downloads(int nowhitelist_flag) { 39static 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 }