Input is copied into a buffer without checking its size.
Replace unbounded copies (strcpy, sprintf) with length-bounded equivalents; validate lengths first.