For the handling of the messages file, there is a path traversal weakness (CWE-22) from
lines 2, 4, and 6. With respect to path traversal, there are at least two opportunities for
a CHECK-BEFORE: checking "ftype" before calling strcat() on line 4, or checking "fname"
before the fopen() on line 6.