Bug 10305 - libldb-1.1.16:attrib_handlers.c:257: possible bad if test ?
Summary: libldb-1.1.16:attrib_handlers.c:257: possible bad if test ?
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: AD: LDB/DSDB/SAMDB (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-02 15:58 UTC by David Binderman
Modified: 2014-01-10 10:28 UTC (History)
0 users

See Also:


Attachments
git-am fix for 4.1.next, 4.0.next. (1.06 KB, patch)
2013-12-11 01:17 UTC, Jeremy Allison
ddiss: review+
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2013-12-02 15:58:37 UTC
I just ran the static analyser "cppcheck" over
the source code of libldb-1.1.16. It said

 [../common/attrib_handlers.c:257] -> [../common/attrib_handlers.c:257]: (style) Same expression on both sides of '&&'.

Source code is

    if (n2 == 0 && n2 == 0) {
        return 0;
    }

I suspect

    if (n1 == 0 && n2 == 0) {
        return 0;
    }

might be better code.
Comment 1 Matthias Dieter Wallnöfer 2013-12-05 21:26:28 UTC
Yes, I think this is true and should be patched.
Comment 2 Jeremy Allison 2013-12-11 01:17:18 UTC
Created attachment 9521 [details]
git-am fix for 4.1.next, 4.0.next.

Fix cherry-picked from what went into master.

Jeremy.
Comment 3 Jeremy Allison 2013-12-18 21:19:08 UTC
Re-assigned to Karolin for inclusion in 4.1.next, 4.0.next.

Jeremy.
Comment 4 Karolin Seeger 2013-12-26 18:28:07 UTC
Pushed to autobuild-v4-1-test and autobuild-v4-0-test.
Comment 5 Karolin Seeger 2013-12-30 18:18:51 UTC
Pushed to v4-1-test and v4-0-test.
Closing out bug reports.

Thanks!