CodeAnt AI home pagelight logodark logo
  • Support
  • Dashboard
  • Dashboard
  • Join Community
Start Here
  • What is CodeAnt?
Setup
  • Github
  • Bitbucket
  • Gitlab
  • Azure Devops
Pull Request Review
  • Features
  • Customize Review
  • Quality Gates
  • Integrations
Code Security
  • Features
Engineering Productivity
  • DORA Metrics
  • Dev Productivity
Code Quality
  • Features
Integrations
  • Jira
  • Test Coverage
  • CI/CD
IDE
  • Setup
  • Review
  • Enhancements
Cloud Security
  • AWS
  • GCP
  • Azure
Rule Reference
  • Compliance
  • Anti-Patterns
  • Code Governance
  • Infrastructure Security Database
  • Application Security Database
    • Apex
    • Bash
    • C
    • Clojure
    • Cpp
      • Lang
        • Correctness
          • Memset-removal
          • Sizeof-pointer-type
          • Sizeof-this
            • Sizeof this
        • Security
      • Libxml2
    • Csharp
    • Dockerfile
    • Elixir
    • Fingerprints
    • Generic
    • Go
    • Html
    • Java
    • Javascript
    • Json
    • Kotlin
    • Ocaml
    • Php
    • Problem-based-packs
    • Python
    • Ruby
    • Rust
    • Scala
    • Solidity
    • Swift
    • Terraform
    • Typescript
    • Yaml
Resources
  • Open Source
  • Blogs
Sizeof-this

Sizeof this

sizeof-this

Do not use sizeof(this) to get the number of bytes of the object in memory. It returns the size of the pointer, not the size of the object.
Likelihood: LOW
Confidence: HIGH
CWE:
- CWE-467: Use of sizeof() on a Pointer Type
Sizeof pointer typeStd vector invalidation
twitterlinkedin
Powered by Mintlify
Assistant
Responses are generated using AI and may contain mistakes.