From: Junio C Hamano <gitster@pobox.com>
To: Melchior FRANZ <mfranz@aon.at>
Cc: git@vger.kernel.org, spearce@spearce.org
Subject: Re: [BUG] remote.c/match_explicit() ... NULL pointer dereferenciation (git 1.5.3.4)
Date: Tue, 30 Oct 2007 11:30:43 -0700 [thread overview]
Message-ID: <7vwst4lajw.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <200710301144.32528@rk-nord.at> (Melchior FRANZ's message of "Tue, 30 Oct 2007 11:44:32 +0100")
Subject: Prevent send-pack from segfaulting (backport from 'master')
4491e62ae932d5774f628d1bd3be663c11058a73 (Prevent send-pack from
segfaulting when a branch doesn't match)
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>
---
Thanks. Shawn fixed it on the 'master' side but 'maint' is
still using the old code.
remote.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/remote.c b/remote.c
index cdbbdcb..9a88917 100644
--- a/remote.c
+++ b/remote.c
@@ -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:
prev parent reply other threads:[~2007-10-30 18:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 10:44 [BUG] remote.c/match_explicit() ... NULL pointer dereferenciation (git 1.5.3.4) Melchior FRANZ
2007-10-30 18:30 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vwst4lajw.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mfranz@aon.at \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).