NetBSD-Bugs archive

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

bin/50966: src/usr.sbin/mtrace/mtrace.c:1097: suspicious condition ?



>Number:         50966
>Category:       bin
>Synopsis:       src/usr.sbin/mtrace/mtrace.c:1097: suspicious condition ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 13 19:35:01 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160313
>Organization:
>Environment:
>Description:
Source code is

   if ((n->tr_inaddr != b->tr_inaddr) || (n->tr_inaddr != b->tr_inaddr))
      return 1;     /* Route changed */

but

    struct tr_resp *b = basep->resps + rno;
    struct tr_resp *p = prev->resps + rno;
    struct tr_resp *n = new->resps + rno;

Suggest either remove the duplicate code, or maybe use all 
three of b, p, n.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index