Re: [PATCH] git-mv: Fix error with multiple sources.

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] git-mv: Fix error with multiple sources.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:05

"David Rydh" [off-list ref] 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.

Re: [PATCH] git-mv: Fix error with multiple sources.

From: David Rydh <hidden>
Date: 2016-06-15 22:48:05

On Jan 21, 2010, at 10:17 PM, Junio C Hamano wrote:
"David Rydh" [off-list ref] writes:
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help