patch-1.3.21 linux/net/core/iovec.c

Next file: linux/net/ipv4/af_inet.c
Previous file: linux/net/core/datagram.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.20/linux/net/core/iovec.c linux/net/core/iovec.c
@@ -64,9 +64,10 @@
 {
 	while(len>0)
 	{
-		memcpy_tofs(iov->iov_base, kdata,iov->iov_len);
-		kdata+=iov->iov_len;
-		len-=iov->iov_len;
+		int copy = min(iov->iov_len,len);
+		memcpy_tofs(iov->iov_base,kdata,copy);
+		kdata+=copy;
+		len-=copy;
 		iov++;
 	}
 }

FUNET's LINUX-ADM group, [email protected]
TCL-scripts by Sam Shen, [email protected] with Sam's (original) version
of this