C/C++

C or C++ : Dangerous pointer manipulation

Classification

Overview

Some arithmetic manipulations on pointers may be dangerous:

  1. Pointer arithmetic on a pointer to base class is dangerous - base and derived may have different sizes.
  2. Pointer arithmetic on non-array variables relies on memory layout, which is dangerous.
  3. Subtraction of two pointers that do not point to the same memory chunk may cause incorrect result.
CRITICAL

DerScanner Severity Score

Check your C/C++ code for this vulnerability, free

Request a free pilot of DerScanner. We give you access and help with the first scan. It works in the cloud and on-premise.

Try it on your code, free

By submitting this form, I acknowledge that DerScanner may process my personal data I provided above for purposes explained above. More details about the processing.