Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary expression, possibly containing a logical error #125

Open
shaue188 opened this issue Oct 24, 2024 · 0 comments
Open

Binary expression, possibly containing a logical error #125

shaue188 opened this issue Oct 24, 2024 · 0 comments

Comments

@shaue188
Copy link

shaue188 commented Oct 24, 2024

Additional context
Our company uses the synaptic package in our Linux distribution. I am working on static analysis, and one of my tasks was to scan the synaptic package. During the scan, I found a bug:

Describe the bug
In
https://github.com/mvo5/synaptic/blob/master/gtk/rgmainwindow.cc#L297-L298

There is code:

if (elem->getFlags() && RPackage::FNew)
    elem->setNew(false);

RPackage::FNew is a constant defined in
https://github.com/mvo5/synaptic/blob/master/common/rpackage.h#L122
and it is equal to 1 << 14

So it looks like a logical error, as I think there should be bitwise operation instead of binary:

if (elem->getFlags() & RPackage::FNew)
    elem->setNew(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant