Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The effects of accessing bits of an object representation that are not part of the object's value representation can range from implementation-defined behavior (such as assuming the layout of fields with differing access controls) to code execution vulnerabilities (such as overwriting the vtable pointer).

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP62-CPP

High

Probable

High

P6

L2

Automated Detection

Tool

Version

Checker

Description

Astrée

Include Page
Astrée_V
Astrée_V

invalid_pointer_dereference
uninitialized_variable_use

CodeSonar
Include Page
CodeSonar_V
CodeSonar_V

BADFUNC.MEMCMP

BADFUNC.MEMSET

Use of memcmp

Use of memset

Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

DF4726, DF4727, DF4728, DF4729, DF4731, DF4732, DF4733, DF4734


Klocwork
Include Page
Klocwork_V
Klocwork_V
CERT.MEMCMP.PADDED_DATA
CWARN.MEM.NONPOD

LDRA tool suite
Include Page
LDRA_V
LDRA_V

618 S

Partially implemented

Parasoft C/C++test

Include Page
Parasoft_V
Parasoft_V

CERT_CPP-EXP62-a

Do not compare objects of a class that may contain padding bits with C standard library functions

Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

CERT C++: EXP62-CPPChecks for access attempts on padding and vtable bits (rule fully covered).
PVS-Studio

Include Page
PVS-Studio_V
PVS-Studio_V

V598, V780, V1084

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

Bibliography

[ISO/IEC 14882-2014]Subclause 3.9, "Types"
Subclause 3.10, "Lvalues and Rvalues"
Clause 9, "Classes"
 
 


...