months.)
The problem is in resolve_extension(). strncpy() will only null-terminate
the destination string if it has enough room, according to the given
length.
In this implementation, there will never be enough room to null-terminate
the string, from what I can tell. So if the memory in 'tmpstr' contains
non-nulls, you'll get a core-dump in the subsequent strcat().