patch-2.1.11 linux/net/ipv4/ip_sockglue.c

Next file: linux/net/ipv4/ipmr.c
Previous file: linux/net/ipv4/ip_fw.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.10/linux/net/ipv4/ip_sockglue.c linux/net/ipv4/ip_sockglue.c
@@ -495,8 +495,11 @@
 					}
 				}
 				err = put_user(opt->optlen, optlen);
-				if (!err)
-					err = copy_to_user(optval, opt->__data, opt->optlen);
+				if (!err) 
+				{
+					if(copy_to_user(optval, opt->__data, opt->optlen))
+					    err = -EFAULT;
+				}
 				return err; 
 			}
 			return 0;
@@ -520,7 +523,11 @@
   			len=strlen(sk->ip_mc_name);
   			err = put_user(len, optlen);
 			if (!err)
+			{
 				err = copy_to_user((void *)optval,sk->ip_mc_name, len);
+				if (err)
+				    err = -EFAULT;
+			}
 			return err;
 #endif
 		default:

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