--- t1env.c.orig 2007-09-16 19:56:38.319184208 +0200 +++ t1env.c 2007-09-16 20:05:02.057070439 +0200 @@ -611,6 +611,12 @@ #endif strcat( pathbuf, DIRECTORY_SEP); /* And finally the filename: */ + /* If current pathbuf + StrippedName + 1 byte for NULL is bigger than pathbuf + let's try next pathbuf */ + if( strlen(pathbuf) + strlen(StrippedName) + 1 > sizeof(pathbuf) ) { + i++; + continue; + } strcat( pathbuf, StrippedName); /* Check for existence of the path: */