diff -Naur t1lib-5.0.2-orig/lib/t1lib/t1env.c t1lib-5.0.2/lib/t1lib/t1env.c --- t1lib-5.0.2-orig/lib/t1lib/t1env.c 2002-11-28 03:53:11 +0200 +++ t1lib-5.0.2/lib/t1lib/t1env.c 2007-09-26 08:33:46 +0300 @@ -568,6 +568,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: */