From c95535bae88651c71eeab8806004994c582256d8 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Thu, 13 Nov 2003 08:46:53 +0000 Subject: [PATCH] (all_names_found): Check if the argument contains valid filename. Fixes coredump on "not_a_tar_file" --- src/names.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 -- 2.45.2