Re: [PATCHv4] Read (but not write) from XDG configuration, XDG attributes and XDG ignore files

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

Re: [PATCHv4] Read (but not write) from XDG configuration, XDG attributes and XDG ignore files

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:59

Ramsay Jones [off-list ref] writes:
Subject: [PATCH] path.c: Fix a static buffer overwrite bug by avoiding mkpath()

In order to fix the bug, we introduce a new variation of the mkpath()
function, mkpathdup(), which avoids the use of the internal static
buffers.
Shouldn't we aim a bit higher to also avoid the use of bounded
buffer?  Instead of returning bad_path, retry with lengthened buffer
until we succeed, or something.

Better yet, internally use strbuf_vaddf().

Re: [PATCHv4] Read (but not write) from XDG configuration, XDG attributes and XDG ignore files

From: Ramsay Jones <hidden>
Date: 2016-06-15 22:54:03

Junio C Hamano wrote:
Ramsay Jones [off-list ref] writes:
quoted
Subject: [PATCH] path.c: Fix a static buffer overwrite bug by avoiding mkpath()

In order to fix the bug, we introduce a new variation of the mkpath()
function, mkpathdup(), which avoids the use of the internal static
buffers.
Shouldn't we aim a bit higher to also avoid the use of bounded
buffer?  Instead of returning bad_path, retry with lengthened buffer
until we succeed, or something.

Better yet, internally use strbuf_vaddf().
Sorry for the late reply, I've been away ...

Yes, I wasn't aiming too high. In fact I was only aiming for "I spent the
last 20 minutes fixing up your patch so that it doesn't tickle the bug
on cygwin, and it looks like this..." :-P

While away, I did rewrite mkpathdup() to address your concerns (although I
didn't use strbuf_vaddf()).

However, I see that Nguyen has not been idle and, with help from others, has
fixed up the patch and re-rolled the series (v7 I think). I haven't fetched
that mail yet, but it looked good and should not tickle the cygwin bug. I will
test it soon.

ATB,
Ramsay Jones
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help