null-pointer-dereference
SolidDetects code that dereferences pointers or return values that could be NULL without validation, causing crashes or privilege escalation.
Data & Documents 32 stars
10 forks Updated 2 months ago NOASSERTION
Install
Quality Score: 72/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Null Pointer Dereference
## Overview
Null pointer dereference occurs when code uses a pointer without checking whether it's NULL. This causes:
- **Crash/DoS**: SIGSEGV on Unix, access violation on Windows
- **Kernel privilege escalation**: NULL pointer dereference in kernel context can map page 0 and execute attacker code
- **Logic bypass**: Skipping NULL checks allows unexpected code paths
## Detection Strategy
- Return values of `malloc()`, `calloc()`, `realloc()` used without NULL check
- Results of `fopen()`, `popen()` dereferenced without NULL check
- Java objects returned from `getById()` or map lookups used without null check
## Remediation
Always check pointers for NULL before dereferencing.
**Vulnerable (C):**
```c
char *buf = malloc(256);
strcpy(buf, input); // buf might be NULL if malloc failed!
```
**Safe (C):**
```c
char *buf = malloc(256);
if (buf == NULL) { perror("malloc"); exit(1); }
strcpy(buf, input);
```
Details
- Author
- zakirkun
- Repository
- zakirkun/ice-tea
- Created
- 2 months ago
- Last Updated
- 2 months ago
- Language
- Go
- License
- NOASSERTION
Similar Skills
Semantically similar based on skill content — not just same category
DevOps & Infrastructure Solid
node.js-
检查 RCE、SSRF、SQL 注入、路径穿越等安全问题,支持 Express/Koa/NestJS
833 Updated 3 days ago
TencentBlueKing Code & Development Featured
code-review
Perform thorough code reviews with security, performance, and maintainability analysis. Use when user asks to review code, check for bugs, or audit a codebase.
62,572 Updated today
shareAI-lab Data & Documents Solid
mobile-security-expert
移动安全漏洞挖掘知识库,基于HackerOne公开报告提供Android和iOS应用的漏洞挖掘手法、技术细节和代码模式分析;用于安全研究人员和漏洞挖掘者学习参考、代码审计和漏洞检测指导。
149 Updated 1 months ago
s7safe Data & Documents Solid
analyze-oops
Analyze a kernel Oops from the printk buffer in a PearPC memory dump
432 Updated 2 weeks ago
sebastianbiallas