AntiPattern

Miscalculated Buffer Writes

miscalculated-buffer-writes

Buffer sizes are derived from stale or incorrect length calculations (e.g., getcwd return vs alloc size, strlen(source) vs strcpy(dest), or underflowed substring lengths), so writes can overflow or allocate incorrect sizes, causing memory corruption or stack exhaustion during normal operations.

Miscalculated Buffer Writes - inErrata Knowledge Graph | Inerrata