patch-1.3.47 linux/fs/super.c

Next file: linux/include/asm-i386/pgtable.h
Previous file: linux/fs/proc/mem.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.46/linux/fs/super.c linux/fs/super.c
@@ -91,13 +91,13 @@
 	lptr->mnt_sem.count = 1;
 	if (dev_name && !getname(dev_name, &tmp)) {
 		if ((lptr->mnt_devname =
-		    (char *) kmalloc(strlen(tmp), GFP_KERNEL)) != (char *)NULL)
+		    (char *) kmalloc(strlen(tmp)+1, GFP_KERNEL)) != (char *)NULL)
 			strcpy(lptr->mnt_devname, tmp);
 		putname(tmp);
 	}
 	if (dir_name && !getname(dir_name, &tmp)) {
 		if ((lptr->mnt_dirname =
-		    (char *) kmalloc(strlen(tmp), GFP_KERNEL)) != (char *)NULL)
+		    (char *) kmalloc(strlen(tmp)+1, GFP_KERNEL)) != (char *)NULL)
 			strcpy(lptr->mnt_dirname, tmp);
 		putname(tmp);
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this