git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: "André Goddard Rosa" <andre.goddard@gmail.com>
Cc: gitster@pobox.com, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Fix segmentation fault when user doesn't have access permission to the repository.
Date: Thu, 22 Nov 2007 17:09:59 +0100	[thread overview]
Message-ID: <20071122160959.GA3411@steel.home> (raw)
In-Reply-To: <b8bf37780711211659i4d621533o6a3b97349bb75f8c@mail.gmail.com>

André Goddard Rosa, Thu, Nov 22, 2007 01:59:00 +0100:
> @@ -487,8 +490,13 @@ static int do_fetch(struct transport *transport,
>  		die("Don't know how to fetch from %s", transport->url);
>  
>  	/* if not appending, truncate FETCH_HEAD */
> -	if (!append)
> -		fclose(fopen(git_path("FETCH_HEAD"), "w"));
> +	if (!append) {
> +		char *filename = git_path("FETCH_HEAD");
> +		int fd = fopen(filename, "w");

This should have been "FILE *fp", not "int fd".

> +		if (!fd)
> +			return error("cannot open %s: %s\n", filename, strerror(errno));
> +		fclose(fd);
> +	}
>  
>  	ref_map = get_ref_map(transport, refs, ref_count, tags, &autotags);
>  
> -- 
> 1.5.3.6.861.gd794-dirty
> 

  reply	other threads:[~2007-11-22 16:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22  0:59 [PATCH] Fix segmentation fault when user doesn't have access permission to the repository André Goddard Rosa
2007-11-22 16:09 ` Alex Riesen [this message]
2007-11-22 22:27   ` André Goddard Rosa
2007-11-25 21:39     ` [Resend PATCH] " André Goddard Rosa
2007-11-30 21:22       ` Junio C Hamano
2007-12-05  7:01         ` fetch_refs_via_pack() discards status? Junio C Hamano
2007-12-05 19:16           ` Daniel Barkalow
2007-12-05 21:06             ` Junio C Hamano
2007-12-06  0:38               ` André Goddard Rosa
2007-12-06 14:09               ` Daniel Barkalow

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=20071122160959.GA3411@steel.home \
    --to=raa.lkml@gmail.com \
    --cc=andre.goddard@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).