[Oisf-devel] detect-engine.c:336: Possible bad if test ?

Victor Julien victor at inliniac.net
Thu Oct 17 14:32:45 UTC 2013


On 10/14/2013 02:20 PM, David Binderman wrote:
> hello there,
> 
> I recently ran the source code of suricata-1.4.6 through
> the static analysis checker cppcheck.
> 
> It said
> 
> [detect-engine.c:336]: (warning) Logical conjunction always evaluates to false: alproto <= 0 && alproto>= 14.
> 
> Source code is
> 
>     if ((list == NULL) ||
>         (alproto <= ALPROTO_UNKNOWN && alproto>= ALPROTO_FAILED) ||
> 
> Suggest swap && for ||

Thanks, done that.

What version of cppcheck are you using? I'm running it every now and
then as well, and didn't see this report.

-- 
---------------------------------------------
Victor Julien
http://www.inliniac.net/
PGP: http://www.inliniac.net/victorjulien.asc
---------------------------------------------




More information about the Oisf-devel mailing list