Re: [PATCH v2 06/21] builtin/receive-pack: fix incorrect pointer arithmetic

2017-03-28 Thread Junio C Hamano
Jeff King writes: > The patch itself is obviously an improvement. It may be worth graduating > separately from the rest of the series. Yup, I will split it out to bc/push-cert-receive-fix that builds directly on an ancient jc/push-cert topic that was merged at v2.2.0-rc0~64. I'll need to drop t

Re: [PATCH v2 06/21] builtin/receive-pack: fix incorrect pointer arithmetic

2017-03-27 Thread Jeff King
On Sun, Mar 26, 2017 at 04:01:28PM +, brian m. carlson wrote: > If we had already processed the last newline in a push certificate, we > would end up subtracting NULL from the end-of-certificate pointer when > computing the length of the line. This would have resulted in an > absurdly large l

[PATCH v2 06/21] builtin/receive-pack: fix incorrect pointer arithmetic

2017-03-26 Thread brian m. carlson
If we had already processed the last newline in a push certificate, we would end up subtracting NULL from the end-of-certificate pointer when computing the length of the line. This would have resulted in an absurdly large length, and possibly a buffer overflow. Instead, subtract the beginning-of-