Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: dvb_demux.c
emard@softhome.net writes:
> Asier Aguirre writes:
>
> > Hi there, I've found a flaw in dvb_demux.c. The value of 'count' in line
> > 269 (see patch) is not granted to be a positive value, yielding in a
> > kernel segfault in the memcopy of line 292, and then hanging the system.
>
> Good point! There are a whole bunch of bad coding of type while(!count).
Hmm, in this file only one more and there it is a loop variable.
> We should instead of while(!count) or while(count != 0) Always use
> expressions
> like while(count > 0), because ">' operator provides safe exit from loop for
> A RANGE OF VALUES THAT DON'T BELONG TO THE LOOP CODE instead of '!='
> operator which provides safe exit for A SINGLE VALUE NOT BELONGING
> TO THE LOOP CODE
Right, that's exactly why I originally used ">" in this case.
Ralph
--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index