Hi Jonathan,

Does the following commit message + patch look good to you?  Can you
edit if needed and sign-off so I can push this for Junio?  Thank you.

From: Jonathan Nieder <jrnie...@gmail.com>
Subject: [PATCH] git svn: avoid uninitialized var in 'reset'

When "git svn reset" is called with an invalid revision, we
bail out and show the user a proper error message instead
of giving them a cryptic one related to git-svn internals.

ref: http://bugs.debian.org/578908
Reported-by: Jens Seidel <jenssei...@users.sf.net>
Acked-by: Eric Wong <normalper...@yhbt.net>
---
 git-svn.perl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 2c86ea2..97f3891 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1185,6 +1185,7 @@ sub cmd_reset {
                    "history\n";
        }
        my ($r, $c) = $gs->find_rev_before($target, not $_fetch_parent);
+       die "Cannot find SVN revision $target\n" unless defined($c);
        $gs->rev_map_set($r, $c, 'reset', $uuid);
        print "r$r = $c ($gs->{ref_id})\n";
 }
@@ -3605,6 +3606,7 @@ sub mkfile {
 
 sub rev_map_set {
        my ($self, $rev, $commit, $update_ref, $uuid) = @_;
+       defined $commit or die "missing arg3\n";
        length $commit == 40 or die "arg3 must be a full SHA1 hexsum\n";
        my $db = $self->map_path($uuid);
        my $db_lock = "$db.lock";
-- 
Eric Wong



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to