Overview
- Bug Type:
- Buffer overflow
- Category:
- Functional Logic & Control Flow
Definition
Writes exceed a buffer's capacity, corrupting adjacent memory and risking code execution.
How to fix Buffer overflow?
Use bounded APIs; validate lengths; add static/dynamic sanitizers (ASAN/UBSAN); prefer safe containers over raw buffers
Symptoms
Observable signs that may indicate Buffer overflow:
- Crashes or corruption after copy/format operations.
- ASAN/Valgrind reports out-of-bounds writes.
- Unusual control flow or return address corruption.
Example Errors:
- AddressSanitizer: stack-buffer-overflow
- Segmentation fault (core dumped)
- Heap corruption detected
