diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-10-12 19:00:15 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-10-12 19:00:15 +0000 |
commit | d56cc94dc01753b4bcd10539116739d1630c3e31 (patch) | |
tree | 791f4ff12dd1f384c9567eea16421af06f7bdac2 | |
parent | 6ce887de0bad5c58ecc7724bc8aea19cdfcabe77 (diff) | |
download | busybox-w32-d56cc94dc01753b4bcd10539116739d1630c3e31.tar.gz busybox-w32-d56cc94dc01753b4bcd10539116739d1630c3e31.tar.bz2 busybox-w32-d56cc94dc01753b4bcd10539116739d1630c3e31.zip |
Fix tar segfault when include list is empty and exclude list is not.
git-svn-id: svn://busybox.net/trunk/busybox@3508 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | Changelog | 2 | ||||
-rw-r--r-- | archival/tar.c | 9 | ||||
-rw-r--r-- | tar.c | 9 |
3 files changed, 14 insertions, 6 deletions
@@ -20,6 +20,8 @@ | |||
20 | -- Fix sed s/[/]// handling (closes: #1208). | 20 | -- Fix sed s/[/]// handling (closes: #1208). |
21 | -- Fix `-/bin/sh' invocation (closes: #1209). | 21 | -- Fix `-/bin/sh' invocation (closes: #1209). |
22 | -- Fix ash exec (noted by Arne Bernin). | 22 | -- Fix ash exec (noted by Arne Bernin). |
23 | -- Fix tar segfault when include list is empty and exclude list is | ||
24 | not. | ||
23 | * Magick | 25 | * Magick |
24 | -- made init run inittab command's in the order they show up | 26 | -- made init run inittab command's in the order they show up |
25 | in the inittab file (FIFO instead of LIFO). | 27 | in the inittab file (FIFO instead of LIFO). |
diff --git a/archival/tar.c b/archival/tar.c index cd563393b..ea0247e56 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -528,7 +528,10 @@ char **merge_list(char **include_list, char **exclude_list) | |||
528 | int new_include_count = 0; | 528 | int new_include_count = 0; |
529 | int include_count = 0; | 529 | int include_count = 0; |
530 | int exclude_count; | 530 | int exclude_count; |
531 | 531 | ||
532 | if (include_list == NULL) | ||
533 | return exclude_list; | ||
534 | |||
532 | while (include_list[include_count] != NULL) { | 535 | while (include_list[include_count] != NULL) { |
533 | int found = FALSE; | 536 | int found = FALSE; |
534 | exclude_count = 0; | 537 | exclude_count = 0; |
@@ -684,8 +687,8 @@ int tar_main(int argc, char **argv) | |||
684 | #ifdef BB_FEATURE_TAR_EXCLUDE | 687 | #ifdef BB_FEATURE_TAR_EXCLUDE |
685 | /* Remove excluded files from the include list */ | 688 | /* Remove excluded files from the include list */ |
686 | if (exclude_list != NULL) { | 689 | if (exclude_list != NULL) { |
687 | /* If both an exclude and include file list was present then | 690 | /* If both an exclude and include file list were present then |
688 | * its an exclude from include list only, if not its really an | 691 | * it's an exclude from include list only, if not it's really an |
689 | * exclude list (and a poor choice of variable names) */ | 692 | * exclude list (and a poor choice of variable names) */ |
690 | if (include_list == NULL) { | 693 | if (include_list == NULL) { |
691 | extract_function |= extract_exclude_list; | 694 | extract_function |= extract_exclude_list; |
@@ -528,7 +528,10 @@ char **merge_list(char **include_list, char **exclude_list) | |||
528 | int new_include_count = 0; | 528 | int new_include_count = 0; |
529 | int include_count = 0; | 529 | int include_count = 0; |
530 | int exclude_count; | 530 | int exclude_count; |
531 | 531 | ||
532 | if (include_list == NULL) | ||
533 | return exclude_list; | ||
534 | |||
532 | while (include_list[include_count] != NULL) { | 535 | while (include_list[include_count] != NULL) { |
533 | int found = FALSE; | 536 | int found = FALSE; |
534 | exclude_count = 0; | 537 | exclude_count = 0; |
@@ -684,8 +687,8 @@ int tar_main(int argc, char **argv) | |||
684 | #ifdef BB_FEATURE_TAR_EXCLUDE | 687 | #ifdef BB_FEATURE_TAR_EXCLUDE |
685 | /* Remove excluded files from the include list */ | 688 | /* Remove excluded files from the include list */ |
686 | if (exclude_list != NULL) { | 689 | if (exclude_list != NULL) { |
687 | /* If both an exclude and include file list was present then | 690 | /* If both an exclude and include file list were present then |
688 | * its an exclude from include list only, if not its really an | 691 | * it's an exclude from include list only, if not it's really an |
689 | * exclude list (and a poor choice of variable names) */ | 692 | * exclude list (and a poor choice of variable names) */ |
690 | if (include_list == NULL) { | 693 | if (include_list == NULL) { |
691 | extract_function |= extract_exclude_list; | 694 | extract_function |= extract_exclude_list; |