Re: [RFC] CDC-NCM: avoid overflow in sanity checking

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

 



On 11.02.22 08:17, Bjørn Mork wrote:
> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> writes:
>
>
> Only  is that the existing code wants the inverted result:
>
>  	if (offset > skb_in->len || len > skb_in->len - offset) ...
>
> with all values unsigned.

Its logic is

if (!sane(fragment))
    continue;
process(fragment);

rather than

if (sane(fragment))
    process(fragment);

A simple matter of inversion.

> And there you point out my problem:  discipline :-)
>
Do we still agree that unsigned integers are the better option?

    Regards
        Oliver





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux