CWE-1335

Incorrect Bitwise Shift of Integer

Medium

Description

An integer value is specified to be shifted by a negative amount or an amount greater than or equal to the number of bits contained in the value causing an unexpected or indeterminate result.

Potential Impact

How to Fix

Implementation

Implicitly or explicitly add checks and mitigation for negative or over-shift values.

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-1335 vulnerabilities in your codebase.

Get Security Assessment