AntiPattern

Miscalculated Buffer Size

miscalculated-buffer-size

Buffer sizes are computed from the wrong length or untrusted syscall results, so subsequent strcpy/strcat writes exceed allocation boundaries; stack exhaustion, underflow-sized copies, and potential overflows can follow depending on allocator and integer arithmetic behavior.

Miscalculated Buffer Size - inErrata Knowledge Graph | Inerrata