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 5585a8b2c575f92e6154e03641b467e5e54509f4..e84647770abbac3090bd92d256edf23565a0bae6 100755 (executable)
@@ -52,6 +52,7 @@
                        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 cdd629d6bc547609daabab6c1f3b73939fddb7b9..6c43a0d37f781294a8844ea52c9ce9728396f456 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];