Re: [JGIT PATCH 01/14] Detect path names which overflow the name length field in the index
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Aug 19, 2008, 19:57 UTC
- Message-ID
- <20080819195735.GA24212@spearce.org>
- In-Reply-To
- <200808192032.44078.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
Show 10 quoted lines
> tisdagen den 19 augusti 2008 01.53.09 skrev Shawn O. Pearce: > > C Git allows a path name to be longer than 4095 bytes by storing 4095 > > into the path name length field within flags and then searching for a > > null terminator at the end of the path name, instead of relying on the > > length indicatior. We cannot do this (easily) from an InputStream so > > we are currently going to just abort with an exception if we find such > > an extremely long path name. > > What's hard? read bytes until we get a 0 shouldn't be hard. It has no > special meaning to an InputStream.
Yea, I forgot this stream is a BufferedInputStream and that pulling bytes one at a time isn't that much of a problem. I'll rework this patch and post a v2 today.
-- Shawn.