From d56cc94dc01753b4bcd10539116739d1630c3e31 Mon Sep 17 00:00:00 2001 From: kraai Date: Fri, 12 Oct 2001 19:00:15 +0000 Subject: 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 --- tar.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tar.c') diff --git a/tar.c b/tar.c index cd563393b..ea0247e56 100644 --- a/tar.c +++ b/tar.c @@ -528,7 +528,10 @@ char **merge_list(char **include_list, char **exclude_list) int new_include_count = 0; int include_count = 0; int exclude_count; - + + if (include_list == NULL) + return exclude_list; + while (include_list[include_count] != NULL) { int found = FALSE; exclude_count = 0; @@ -684,8 +687,8 @@ int tar_main(int argc, char **argv) #ifdef BB_FEATURE_TAR_EXCLUDE /* Remove excluded files from the include list */ if (exclude_list != NULL) { - /* If both an exclude and include file list was present then - * its an exclude from include list only, if not its really an + /* If both an exclude and include file list were present then + * it's an exclude from include list only, if not it's really an * exclude list (and a poor choice of variable names) */ if (include_list == NULL) { extract_function |= extract_exclude_list; -- cgit v1.2.3-55-g6feb