patch-2.1.20 linux/fs/isofs/symlink.c

Next file: linux/fs/locks.c
Previous file: linux/fs/isofs/rock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.19/linux/fs/isofs/symlink.c linux/fs/isofs/symlink.c
@@ -83,7 +83,6 @@
 {
         char * pnt;
 	int i;
-	char c;
 
 	if (!S_ISLNK(inode->i_mode)) {
 		iput(inode);
@@ -97,12 +96,12 @@
 	iput(inode);
 	if (!pnt)
 		return 0;
-	i = 0;
 
-	while (i<buflen && (c = pnt[i])) {
-		i++;
-		put_user(c,buffer++);
-	}
+	i = strlen(pnt)+1;
+	if (i > buflen)
+		i = buflen; 
+	if (copy_to_user(buffer, pnt, i))
+		i = -EFAULT; 	
 	kfree(pnt);
 	return i;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov