On 2023-02-07 01:35 +01, Alexander Bluhm <alexander.bl...@gmx.net> wrote:
> On Tue, Jan 31, 2023 at 11:32:44PM +0100, Jan Klemkow wrote:
>> On Tue, Jan 31, 2023 at 09:12:51PM +0100, Christian Weisgerber wrote:
>> > >  - Check if the mbuf is large enough for an ether header.
>
>> if (m == NULL || m->m_len - hoff < sizeof(*ext->ip4))
>
> Could you change this code to
>
>   if (m == NULL || m->m_len < sizeof(*ext->ip4) + hoff)
>
> I don't want to think about what happens if there is an integer
> underflow.  Overflow cannot happen as hoff should be much smaller
> than maximum size_t.  Or is it just me who does not understand the
> C conversion from negative int to size_t comparison.
>

It's not just you...

Reply via email to