]> Dogcows Code - chaz/tar/commitdiff
(all_names_found): Check if the argument
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 13 Nov 2003 08:46:53 +0000 (08:46 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 13 Nov 2003 08:46:53 +0000 (08:46 +0000)
contains valid filename. Fixes coredump on "not_a_tar_file"

src/names.c

index 3ebf9cb2f25911098a43871ebf98561aed4b34c1..951a9677dad95cff8badc80fd84330186032b34e 100644 (file)
@@ -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
This page took 0.028033 seconds and 4 git commands to generate.