logo       

Re: Patch: minor nit in ip_options_compile(): msg#00204

Subject: Re: Patch: minor nit in ip_options_compile()
Hello!

> In the following else clause, we check for opt->is_data, which=20
> should always be set for this case, and if not, current code will
> lead to a null ptr dereference because skb is always null in=20
> this case..

You misunderstood tha code. If opt->is_data is clear skb may be not NULL.
The option is not used at the moment, but it it pretty silly to lose this.

> Look reasonable?=20

No:

> +=09=09if ((optptr =3D opt->__data) =3D=3D 0)
> +=09=09=09goto error;=20

is identical FALSE. [Sent quatable-printable attachment? Get it
back quoted. :-)]


> Figured its better to fall down to returning EINVAL..

if (skb == NULL)
   BUG();

Listen, I love to add BUG()s when it is not mathematically
clear that something is invariant. Not in this trivial case.

Alexey




<Prev in Thread] Current Thread [Next in Thread>