Merge branch 'maint' of git://repo.or.cz/git/fastimport into maint
authorJunio C Hamano <junkio@cox.net>
Sun, 29 Apr 2007 01:15:00 +0000 (18:15 -0700)
committerJunio C Hamano <junkio@cox.net>
Sun, 29 Apr 2007 01:15:00 +0000 (18:15 -0700)
* 'maint' of git://repo.or.cz/git/fastimport:
  Don't allow empty pathnames in fast-import
  import-tars: be nice to wrong directory modes

contrib/fast-import/import-tars.perl
fast-import.c

index 5585a8b..e846477 100755 (executable)
@@ -52,6 +52,7 @@ foreach my $tar_file (@ARGV)
                        Z8 Z1 Z100 Z6
                        Z2 Z32 Z32 Z8 Z8 Z*', $_;
                last unless $name;
+               next if $name =~ '/$';
                $mode = oct $mode;
                $size = oct $size;
                $mtime = oct $mtime;
index cdd629d..6c43a0d 100644 (file)
@@ -1193,6 +1193,8 @@ static int tree_content_set(
                n = slash1 - p;
        else
                n = strlen(p);
+       if (!n)
+               die("Empty path component found in input");
 
        for (i = 0; i < t->entry_count; i++) {
                e = t->entries[i];