Re: [PATCH v3 9/9] fixup! remote-curl: error on incomplete packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 22, 2020 at 12:05:52PM -0400, Denton Liu wrote:

> Hi Peff,
> 
> On Fri, May 22, 2020 at 11:54:10AM -0400, Jeff King wrote:
> > > -printf "%s\n" "00"
> > > +printf "%s" "00"
> > 
> > This one is a behavior improvement: we were probably hitting "oops,
> > newline isn't a valid line-length character" before, and now we're
> > really hitting the truncated packet.
> 
> The test currently actually greps for the "incomplete length" error
> message and it passes so the behaviour remains the same. We just got
> lucky that we send "00" instead of "000" beacuse "000\n" would've
> otherwise given us a full length header.

Ah, OK. I was surprised it didn't hit your new code in check_pktline()
that complains about non-hex chars. But the reason is that we don't
check digit-by-digit as we read them. We wait until we have 4 chars, and
then we feed the whole thing to packet_length(). But since we only
receive 3, the state machine doesn't move to that step. So that makes
sense.

> > I don't know if it's worth adding an extra test with a bogus
> > line-length. I'm OK with with it either way.
> 
> I think I'll leave this unless anyone really wants this to be tested.

Sounds good.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux