author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 25 Sep 2007 04:13:25 +0000 (00:13 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 25 Sep 2007 06:25:26 +0000 (23:25 -0700) | ||
commit | 4491e62ae932d5774f628d1bd3be663c11058a73 | |
tree | 4a47cf0b2da34de6a673703e388dadd3442c1a6b | tree | snapshot |
parent | 7dfee372b08f653c2709c90bea986e4ed608f410 | commit | diff |
Prevent send-pack from segfaulting when a branch doesn't match
If `git push url foo` can't find a local branch named foo we can't
match it to any remote branch as the local branch is NULL and its
name is probably at position 0x34 in memory. On most systems that
isn't a valid address for git-send-pack's virtual address space
and we segfault.
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: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If `git push url foo` can't find a local branch named foo we can't
match it to any remote branch as the local branch is NULL and its
name is probably at position 0x34 in memory. On most systems that
isn't a valid address for git-send-pack's virtual address space
and we segfault.
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: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c | diff | blob | history |