From: Sergey Poznyakoff Date: Thu, 13 Nov 2003 08:46:53 +0000 (+0000) Subject: (all_names_found): Check if the argument X-Git-Url: https://git.dogcows.com/gitweb?a=commitdiff_plain;h=c95535bae88651c71eeab8806004994c582256d8;p=chaz%2Ftar (all_names_found): Check if the argument contains valid filename. Fixes coredump on "not_a_tar_file" --- diff --git a/src/names.c b/src/names.c index 3ebf9cb..951a967 100644 --- a/src/names.c +++ b/src/names.c @@ -608,9 +608,11 @@ bool all_names_found (struct tar_stat_info *p) { struct name const *cursor; - size_t len = strlen (p->file_name); - if (occurrence_option == 0 || p->had_trailing_slash) + size_t len; + + if (!p->file_name || occurrence_option == 0 || p->had_trailing_slash) return false; + len = strlen (p->file_name); for (cursor = namelist; cursor; cursor = cursor->next) { if (cursor->regexp