[PATCH 06/12] Start actually parsing the git object data

Dirk Hohndel dirk at hohndel.org
Sun Mar 9 21:06:00 PDT 2014


On Sun, 2014-03-09 at 20:48 -0700, Linus Torvalds wrote:
> On Sun, Mar 9, 2014 at 8:14 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
> >
> >> +#define MAXLINE 100
> >
> > Can you remind me why this is a valid assumption?
> > We simply ensure this max length when writing and then any tool outside
> > of Subsurface that manipulates the git objects needs to make sure this
> > is still enforced?
> 
> Note that the MAXLINE data doesn't contain the actual strings, so it's
> basically "maximum data on a line that isn't strings".

Yeah, I saw that.

> And 100 is just a random value. I briefly considered making that
> string a "membuffer" too and not have any limits, but I didn't see any
> real upsides. We do protect in the line reading code against
> overflowing, so if somebody edits lines by hand to be invalidly long,
> we just truncate them.

Yes, so even if someone messed with the git objects it still couldn't be
used to crash Subsurface...

> The longest lines would be the sample lines that have all of the
> fields, and I think you can get pretty close to a hundred if you have
> all the fields (including heartbeat and bearing and all the stop times
> and ddepths). Maybe we could make the 100 be 500, and it wouldn't even
> be close.

Yes, I'd be more comfortable with that.

/D



More information about the subsurface mailing list