⬢ DragonFlyBSD Kernel Audit
DF-3115 / fix.diff
← back to finding ↓ download raw
--- a/sys/vfs/msdosfs/msdosfs_conv.c
+++ b/sys/vfs/msdosfs/msdosfs_conv.c
@@ -1034,9 +1034,11 @@ int
 mbnambuf_write(struct mbnambuf *nbp, char *name, int id)
 {
 	char *slot;
 	size_t count, newlen;
 
 	if (nbp->nb_len != 0 && id != nbp->nb_last_id - 1) {
+#ifdef MSDOSFS_DEBUG
 		kprintf("msdosfs: non-decreasing id: id %d, last id %d\n",
 		    id, nbp->nb_last_id);
+#endif
 		return (EINVAL);
 	}
 
@@ -1043,8 +1045,10 @@ mbnambuf_write(struct mbnambuf *nbp, char *name, int id)
 	/* Will store this substring in a WIN_CHARS-aligned slot. */
 	slot = &nbp->nb_buf[id * WIN_CHARS];
 	count = strlen(name);
 	newlen = nbp->nb_len + count;
 	if (newlen > WIN_MAXLEN || newlen > 127) {
+#ifdef MSDOSFS_DEBUG
 		kprintf("msdosfs: file name length %zu too large\n", newlen);
+#endif
 		return (ENAMETOOLONG);
 	}