V617. Consider inspecting the condition. An argument of the '|' bitwise operation always contains a non-zero value.
V617 Consider inspecting the condition. The '0x0002' argument of the '|' bitwise operation contains a non-zero value. tffdshowpageenc.cpp 425
#define ODA_SELECT 0x0002
INT_PTR TffdshowPageEnc::msgProc(UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
....
if ((dis->itemAction | ODA_SELECT)
&& (dis->itemState & ODS_SELECTED)) {
....
}
V617 Consider inspecting the condition. The '0x00000001' argument of the '|' bitwise operation contains a non-zero value. kitcpp.cpp 304
#define FILE_ATTRIBUTE_READONLY 0x00000001
BOOL DeleteAnyFile( char* cFileName ) {
....
if ( nAttr | FILE_ATTRIBUTE_READONLY ) {
nAttr &= ~FILE_ATTRIBUTE_READONLY ;
SetFileAttributes( cFileName, nAttr ) ;
}
....
}
V617 Consider inspecting the condition. The '0x00000800' argument of the '|' bitwise operation contains a non-zero value. resizablepageex.cpp 88
#define PSP_HIDEHEADER 0x00000800
BOOL CResizablePageEx::NeedsRefresh(....)
{
if (m_psp.dwFlags | PSP_HIDEHEADER)
return TRUE;
....
}
V617 Consider inspecting the condition. The '0x0010' argument of the '|' bitwise operation contains a non-zero value. s3_srvr.c 2343
#define EVP_PKT_SIGN 0x0010
int ssl3_get_cert_verify(SSL *s)
{
int type=0, i, j;
....
if ((peer != NULL) && (type | EVP_PKT_SIGN))
....
}
V617 Consider inspecting the condition. The '0x00000002l' argument of the '|' bitwise operation contains a non-zero value. cproxydirect3ddevice9.cpp 520
#define D3DCLEAR_ZBUFFER 0x00000002l
HRESULT CProxyDirect3DDevice9::Clear(....)
{
if ( Flags | D3DCLEAR_ZBUFFER )
CGraphics::GetSingleton().
GetRenderItemManager ()->SaveReadableDepthBuffer();
....
}
Similar errors can be found in some other places:
V617 Consider inspecting the condition. The '(0x0008 + 0x2000 + 0x4000)' argument of the '|' bitwise operation contains a non-zero value. dlgmisc.c 409
....
#define wkHdr 0x4000
#define wkFtn 0x2000
#define wkAtn 0x0008
....
#define wkSDoc (wkAtn+wkFtn+wkHdr)
CMD CmdGoto (pcmb)
CMB * pcmb;
{
....
int wk = PwwdWw(wwCur)->wk;
if (wk | wkSDoc)
NewCurWw((*hmwdCur)->wwUpper, fTrue);
....
}
Most likely this is what should be written here: if (wk & wkSDoc)
V617 Consider inspecting the condition. The 'MAYBE_LOCAL_SSRC' argument of the '|' bitwise operation contains a non-zero value. mediapipelinefilter.cpp 118
static const uint8_t MAYBE_LOCAL_SSRC = 1;
bool MediaPipelineFilter::CheckRtcpSsrc(
const unsigned char* data,
size_t len,
size_t ssrc_offset,
uint8_t flags) const
{
....
if (flags | MAYBE_LOCAL_SSRC) {
....
}
Similar errors can be found in some other places:
V617 Consider inspecting the condition. The '0x00000080' argument of the '|' bitwise operation contains a non-zero value. mac_bsdextended.c 128
#define MBO_TYPE_DEFINED 0x00000080
static int
ugidfw_rule_valid(struct mac_bsdextended_rule *rule)
{
....
if ((rule->mbr_object.mbo_neg | MBO_TYPE_DEFINED) && // <=
(rule->mbr_object.mbo_type | MBO_ALL_TYPE) != MBO_ALL_TYPE)
return (EINVAL);
if ((rule->mbr_mode | MBI_ALLPERM) != MBI_ALLPERM)
return (EINVAL);
return (0);
}
V617 CWE-480 Consider inspecting the condition. The '0x0001' argument of the '|' bitwise operation contains a non-zero value. nfs_upcall.c 331
#define NFS_UC_QUEUE_SLEEPING 0x0001
static void
nfsrv_uc_proxy(socket_t so, void *arg, int waitflag)
{
....
if (myqueue->ucq_flags | NFS_UC_QUEUE_SLEEPING)
wakeup(myqueue);
....
}
V617 CWE-480 Consider inspecting the condition. The '0x00000001' argument of the '|' bitwise operation contains a non-zero value. egl.cpp 1329
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
EGLContext eglCreateContext(....)
{
....
case EGL_CONTEXT_FLAGS_KHR:
if ((attrib_val | EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR) ||
(attrib_val | EGL_CONTEXT_OPENGL_FORWARD_C....) ||
(attrib_val | EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR))
{
context_flags = attrib_val;
} else {
RETURN_ERROR(EGL_NO_CONTEXT,EGL_BAD_ATTRIBUTE);
}
....
}
Similar errors can be found in some other places:
V617 Consider inspecting the condition. The '((1L << STRUCT_CHRONOSPHERE))' argument of the '|' bitwise operation contains a non-zero value. HOUSE.CPP 5089
typedef enum StructType : char {
STRUCT_NONE=-1,
STRUCT_ADVANCED_TECH,
STRUCT_IRON_CURTAIN,
STRUCT_WEAP,
STRUCT_CHRONOSPHERE, // 3
....
}
#define STRUCTF_CHRONOSPHERE (1L << STRUCT_CHRONOSPHERE)
UrgencyType HouseClass::Check_Build_Power(void) const
{
....
if (State == STATE_THREATENED || State == STATE_ATTACKED) {
if (BScan | (STRUCTF_CHRONOSPHERE)) { // <=
urgency = URGENCY_HIGH;
}
}
....
}
This is exactly the case when a reply to a comment turned into a small blog post. The power of ...