netdev
[Top] [All Lists]

[PATCH 4/4] rose check error on memcpy_fromiovec

To: netdev@xxxxxxxxxxx
Subject: [PATCH 4/4] rose check error on memcpy_fromiovec
From: Chris Wright <chrisw@xxxxxxxx>
Date: Mon, 8 Dec 2003 20:27:29 -0800
Cc: davem@xxxxxxxxxx, shemminger@xxxxxxxx
In-reply-to: <20031208202517.E30587@xxxxxxxxxxxxxxxxxx>; from chrisw@xxxxxxxx on Mon, Dec 08, 2003 at 08:25:17PM -0800
References: <20031208202302.C30587@xxxxxxxxxxxxxxxxxx> <20031208202414.D30587@xxxxxxxxxxxxxxxxxx> <20031208202517.E30587@xxxxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
Check the return value on memcpy_fromiovec().

===== net/rose/af_rose.c 1.33 vs edited =====
--- 1.33/net/rose/af_rose.c     Tue Sep  9 11:22:56 2003
+++ edited/net/rose/af_rose.c   Mon Dec  8 16:58:33 2003
@@ -1079,7 +1079,11 @@
 
        asmptr = skb->h.raw = skb_put(skb, len);
 
-       memcpy_fromiovec(asmptr, msg->msg_iov, len);
+       err = memcpy_fromiovec(asmptr, msg->msg_iov, len);
+       if (err) {
+               kfree_skb(skb);
+               return err;
+       }
 
        /*
         *      If the Q BIT Include socket option is in force, the first

<Prev in Thread] Current Thread [Next in Thread>