Skip to content
OpenAdvisories

Weakness (CWE)

CWE-192: Integer Coercion Error

Variant Incomplete

Integer coercion refers to a set of flaws pertaining to the type casting, extension, or truncation of primitive data types.

How to prevent it (3 mitigations)
  1. Requirements

    A language which throws exceptions on ambiguous data casts might be chosen.

  2. Architecture and Design

    Design objects and program flow such that multiple or complex casts are unnecessary

  3. Implementation

    Ensure that any data type casting that you must use is entirely understood in order to reduce the plausibility of error in use.

Source: MITRE CWE-192

1 result · Clear filters · Feed