git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Rydh <dary@math.berkeley.edu>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH] git-mv: Fix error with multiple sources.
Date: Fri, 22 Jan 2010 08:49:08 -0800	[thread overview]
Message-ID: <D7FDF1CC-CED4-4CE8-9FEC-6A630830504C@math.berkeley.edu> (raw)
In-Reply-To: <7vhbqeacjm.fsf@alter.siamese.dyndns.org>


On Jan 21, 2010, at 10:17 PM, Junio C Hamano wrote:

> "David Rydh" <dary@math.berkeley.edu> writes:
> 
>> This commit also fixed two potentially dangerous uses of
>> prefix_filename() -- which returns static storage space -- in
>> builtin-config.c and hash-object.c.
> 
> This should probably be a separate patch.  builtin-hash-object.c also uses
> prefix_filename() first to obtain vpath without strdup() and then uses the
> function to create arg, which seems to be unsafe to me.  I've looked at
> all the hits from 
> 
>    $ git grep -n -e prefix_filename\( -- '*.c'
> 
> and other places seem to be Ok.


Yes, this was how I found these two places. Do you agree that strdup'ing vpath as I did in the patch fixes this flaw? (I assume that builtin-hash-object.c = hash-object.c) I'll split it up into two patches.

  reply	other threads:[~2010-01-22 16:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-21 20:39 [PATCH] git-mv: Fix error with multiple sources David Rydh
2010-01-22  5:57 ` Junio C Hamano
2010-01-22 16:41   ` David Rydh
2010-01-22  6:17 ` Junio C Hamano
2010-01-22 16:49   ` David Rydh [this message]
2010-01-22  6:24 ` Junio C Hamano
     [not found]   ` <7vr5pi8x6z.fsf@alter.siamese.dyndns.org>
2010-01-22 17:30     ` David Rydh
2010-01-22 18:34     ` Johannes Sixt
2010-01-22  7:03 ` Matthieu Moy
2010-01-22  7:29 ` Johannes Sixt

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=D7FDF1CC-CED4-4CE8-9FEC-6A630830504C@math.berkeley.edu \
    --to=dary@math.berkeley.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.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).