=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/file/Attic/fsmagic.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/file/Attic/fsmagic.c 1998/07/10 15:05:22 1.4 --- src/usr.bin/file/Attic/fsmagic.c 1999/12/06 00:32:29 1.5 *************** *** 1,4 **** ! /* $OpenBSD: fsmagic.c,v 1.4 1998/07/10 15:05:22 mickey Exp $ */ /* * fsmagic - magic based on filesystem info - directory, special files, etc. --- 1,4 ---- ! /* $OpenBSD: fsmagic.c,v 1.5 1999/12/06 00:32:29 deraadt Exp $ */ /* * fsmagic - magic based on filesystem info - directory, special files, etc. *************** *** 53,59 **** #include "file.h" #ifndef lint ! static char *moduleid = "$OpenBSD: fsmagic.c,v 1.4 1998/07/10 15:05:22 mickey Exp $"; #endif /* lint */ int --- 53,59 ---- #include "file.h" #ifndef lint ! static char *moduleid = "$OpenBSD: fsmagic.c,v 1.5 1999/12/06 00:32:29 deraadt Exp $"; #endif /* lint */ int *************** *** 132,142 **** if ((tmp = strrchr(fn, '/')) == NULL) { tmp = buf; /* in current directory anyway */ ! } ! else { ! strcpy (buf2, fn); /* take directory part */ buf2[tmp-fn+1] = '\0'; ! strcat (buf2, buf); /* plus (relative) symlink */ tmp = buf2; } if (stat(tmp, &tstatbuf) < 0) { --- 132,144 ---- if ((tmp = strrchr(fn, '/')) == NULL) { tmp = buf; /* in current directory anyway */ ! } else if (strlen(fn) + strlen(buf) > sizeof(buf2)-1) { ! ckfprintf(stdout, "name too long %s", fn); ! return 1; ! } else { ! strcpy (buf2, fn); /* ok; take directory part */ buf2[tmp-fn+1] = '\0'; ! strcat (buf2, buf); /* ok; plus (relative) symlink */ tmp = buf2; } if (stat(tmp, &tstatbuf) < 0) {