Re: [PATCH v2 3/3] sideband: add defense against packets missing a band designator
- From
Jeff King <peff@peff.net>
- Date
- Oct 23, 2020, 08:34 UTC
- Message-ID
- <20201023083424.GD4012156@coredump.intra.peff.net>
- In-Reply-To
- <c61e560451c4d7f101a23acec69117ddac563330.1603136143.git.gitgitgadget@gmail.com>
On Mon, Oct 19, 2020 at 07:35:42PM +0000, Johannes Schindelin via GitGitGadget wrote:
Show 8 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de> > > While there is currently no instance of code producing this type of > packet, if the `demultiplex_sideband()` would receive a packet whose > payload is not only empty but even misses the band designator, it would > mistake it for a flush packet. > > Let's defend against such a bug in the future.
That seems reasonable, but I'm not sure if these ought to be BUG()s. Isn't it an indication that the other side sent us bogus input? That likely is a bug on the other end, but I think it should be a die(), just as we would produce for any other malformed protocol input.
-Peff