Skip to content

Commit

Permalink
git-svn: avoid crashing svnserve when creating new directories
Browse files Browse the repository at this point in the history
When sorting directory names by depth (slash ("/") count) and
closing the deepest directories first (as the protocol
requires), we failed to put the root baton (with an empty string
as its key "") after top-level directories (which did not have
any slashes).

This resulted in svnserve being in a situation it couldn't
handle and caused a segmentation fault on the remote server.

This bug did not affect users of DAV and filesystem repositories.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Confirmed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed May 19, 2007
1 parent 97925fd commit 6442754
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2841,8 +2841,10 @@ sub close_edit {
my ($self) = @_;
my ($p,$bat) = ($self->{pool}, $self->{bat});
foreach (sort { $b =~ tr#/#/# <=> $a =~ tr#/#/# } keys %$bat) {
next if $_ eq '';
$self->close_directory($bat->{$_}, $p);
}
$self->close_directory($bat->{''}, $p);
$self->SUPER::close_edit($p);
$p->clear;
}
Expand Down

0 comments on commit 6442754

Please sign in to comment.