Thread (6 messages) flat view 6 messages, 4 authors, 2016-06-15

Re: [PATCH 1/3] prune-packed: fix a possible buffer overflow

From: Michael Haggerty <hidden>
Date: 2016-06-15 22:59:29

Possibly related (same subject, not in this thread)

On 12/17/2013 07:43 PM, Junio C Hamano wrote:
Duy Nguyen [off-list ref] writes:
quoted
Why don't we take this opportunity to replace that array with a
strbuf? The conversion looks simple with this function.
Indeed.  Something like this, perhaps?
[...]
Frankly, with my initial patches I was just trying to paper over the bug
with the smallest possible change.  It's nice that people are attempting
bigger improvements.

I went in a slightly different direction: I am spiking out an API for
iterating over loose object files.  It would be useful in a couple of
places.

[While doing so, I got sidetracked by the question: what happens if a
prune process deletes the "objects/XX" directory just the same moment
that another process is trying to write an object into that directory?
I think the relevant function is sha1_file.c:create_tmpfile().  It looks
like there is a nonzero but very small race window that could result in
a spurious "unable to create temporary file" error, but even then I
don't think there would be any corruption or anything.]

But don't let me stop you; the cleanups you are working on are
definitely nice and are complementary to my ideas.

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help