aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-28 18:15:00 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-28 18:15:00 -0700
commit5b5fe9a526e3841ff6f61dda743b9624dc8f6426 (patch)
tree0ddaaf80d2fd3b7b85ce00ee43f8863167d2ad44
parentcb2cada6da9d71604fd09efbff47cddbea453e1e (diff)
parentec771a7084ed9352ac6b14ed6ff437e67aba0f0b (diff)
downloadgit-5b5fe9a526e3841ff6f61dda743b9624dc8f6426.tar.gz
git-5b5fe9a526e3841ff6f61dda743b9624dc8f6426.tar.xz
Merge branch 'maint' of git://repo.or.cz/git/fastimport into maint
* 'maint' of git://repo.or.cz/git/fastimport: Don't allow empty pathnames in fast-import import-tars: be nice to wrong directory modes
-rwxr-xr-xcontrib/fast-import/import-tars.perl1
-rw-r--r--fast-import.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 5585a8b2c..e84647770 100755
--- a/contrib/fast-import/import-tars.perl
+++ b/contrib/fast-import/import-tars.perl
@@ -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;
diff --git a/fast-import.c b/fast-import.c
index cdd629d6b..6c43a0d37 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -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];