[Bug 1149] New: xtables-eb.c:533: bad test ?

bugzilla-daemon at netfilter.org bugzilla-daemon at netfilter.org
Fri May 19 20:59:18 CEST 2017


https://bugzilla.netfilter.org/show_bug.cgi?id=1149

            Bug ID: 1149
           Summary: xtables-eb.c:533: bad test ?
           Product: netfilter/iptables
           Version: unspecified
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: ip_tables (kernel)
          Assignee: netfilter-buglog at lists.netfilter.org
          Reporter: dcb314 at hotmail.com

xtables-eb.c:533:65: warning: logical 'and' of mutually exclusive tests is
always false [-Wlogical-op]

Source code is

    if (optind + 1 >= argc || (argv[optind][0] == '-' && (argv[optind][1] < '0'
|| argv[optind][1] > '9')) ||
        (argv[optind + 1][0] == '-' && (argv[optind + 1][1] < '0'  &&
argv[optind + 1][1] > '9')))

Maybe better code

    if (optind + 1 >= argc 
        || (argv[optind][0] == '-' 
            && (argv[optind][1] < '0' || argv[optind][1] > '9')) 
        || (argv[optind + 1][0] == '-' 
            && (argv[optind + 1][1] < '0'  || argv[optind + 1][1] > '9')))

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20170519/f8f28afb/attachment.html>


More information about the netfilter-buglog mailing list