1. CVE archive
  2. Vulnerability types
  3. CWE-467
CWE-467 · #590 most frequent type in the archive

Use of sizeof() on a Pointer Type

The code calls sizeof() on a pointer type, when the programmer intended to determine the size of the data that is being pointed to.

Part of: CWE-131 · Incorrect Calculation of Buffer Size

3CVEs of this type in the archive
0critical (CVSS ≥ 9)
1high severity (7–8.9)
Jul 10, 2026latest published

What it is

The code calls sizeof() on a pointer type, when the programmer intended to determine the size of the data that is being pointed to.

Impact on systems

ScopeImpact
Integrity, Confidentiality Modify Memory, Read Memory
This error can often cause one to allocate a buffer that is much smaller than what is needed, leading to resultant weaknesses such as buffer overflows.

How to prevent it

Implementation Use expressions such as sizeof(*pointer) instead of sizeof(pointer), unless you intend to run sizeof() on a pointer type to gain some platform independence or if you are allocating a variable on the stack.

Source: MITRE CWE catalog · Official entry on the MITRE website

CWE-467 CVEs published per year

2026: year in progress, updated every hour

Show the data as a table
YearCVE
20201
20251
20261

All CWE-467 CVEs

3 results

Dottor Marc

Is this type of vulnerability in your systems?

An archive tells you what exists; a Vulnerability Assessment tells you what is exposed on your side. Dottor Marc tests your web applications and network with automated and manual checks.