Closed whyman closed 3 years ago
The real problem is not the strncpy(). The real problem is alloca(). As far as I can read, *hoststr becomes a pointer to invalid memory after the function returns and is used later. Totally bogus code.
I have committed a fix.
Just found out that there are 2 more examples of this code in the same file, with an even worse bug.