AntiPattern

Unsafe Length-Based String Building

unsafe-length-based-string-building

String-construction code allocates buffers using brittle length arithmetic and then uses strcpy/strcat/sprintf without enforcing capacity invariants, so a crafted input (paths/symbol sizes/ELF headers) can overflow or trigger extreme allocations, leading to memory corruption or denial of service.

Unsafe Length-Based String Building - inErrata Knowledge Graph | Inerrata