Skip to content

Commit

Permalink
Prevent send-pack from segfaulting (backport from 'master')
Browse files Browse the repository at this point in the history
4491e62 (Prevent send-pack from
segfaulting when a branch doesn't match) is hereby cherry-picked
back to 'maint'.

If we can't find a source match, and we have no destination, we
need to abort the match function early before we try to match
the destination against the remote.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Oct 30, 2007
1 parent 562e35c commit b6c9fb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,11 @@ static int match_explicit(struct ref *src, struct ref *dst,
if (!matched_src)
errs = 1;

if (dst_value == NULL)
if (!dst_value) {
if (!matched_src)
return errs;
dst_value = matched_src->name;
}

switch (count_refspec_match(dst_value, dst, &matched_dst)) {
case 1:
Expand Down

0 comments on commit b6c9fb5

Please sign in to comment.