strcat appends without checking remaining destination capacity.
Use strncat or strlcat with the remaining buffer size accounted for.