Get Started
- CodeAnt AI
- Setup
- Control Center
- Pull Request Review
- IDE
- 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
- 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
Sizeof-pointer-type
Sizeof pointer type
Using sizeof(...)
on a pointer type is error prone and can lead to memory corruption if the incorrect size is used to allocate memory. An explicit length should be used instead of using sizeof(...)
.
Likelihood: LOW
Confidence: MEDIUM
CWE:
- CWE-467: Use of sizeof() on a Pointer Type