Re: [PATCH v3 02/19] builtin/diff-tree: convert to struct object_id
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- Feb 18, 2017, 19:12 UTC
- Message-ID
- <20170218191217.thn3c2bympv2g7pm@genre.crustytoothpaste.net>
- In-Reply-To
- <20170218031530.2bhlnjcukl4ybt6h@sigill.intra.peff.net>
On Fri, Feb 17, 2017 at 10:15:31PM -0500, Jeff King wrote:
Show 14 quoted lines
> So for this case, something like the patch below. > > Incidentally, there's an off-by-one in the original loop of > stdin_diff_commit that reads past the end of the trailing NUL for the > final sha1 on the line. The problem is the: > > pos += GIT_SHA1_HEXSZ + 1; > > which assumes we're slurping up the trailing space. This works in > practice because the caller will only permit a string which had a > newline (which it converted into a NUL). > > I suspect that function could be more aggressive about complaining about > nonsense on the line, rather than silently ignoring it.
I'd come to basically the same patch, but I did pick up a few niceties from your patch, like avoiding the off-by-one issue you mentioned above. Can I place your sign-off on the resulting change?
-- brian m. carlson / brian with sandals: Houston, Texas, US +1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204