[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPgLHd-yEmt_BJ52uZNsCA_-w85VhnN_HbfjG1QLVvR5kp7Xvw@mail.gmail.com>
Date: Tue, 9 Apr 2013 10:07:19 +0800
From: Wei Yongjun <weiyj.lk@...il.com>
To: ralf@...ux-mips.org, minipli@...glemail.com, davem@...emloft.net
Cc: yongjun_wei@...ndmicro.com.cn, linux-hams@...r.kernel.org,
netdev@...r.kernel.org
Subject: [PATCH -next] netrom: fix invalid use of sizeof in nr_recvmsg()
From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
sizeof() when applied to a pointer typed expression gives the size of the
pointer, not that of the pointed data.
Introduced by commit 3ce5ef(netrom: fix info leak via msg_name in nr_recvmsg)
Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
---
net/netrom/af_netrom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 7fcb307..103bd70 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1173,7 +1173,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
}
if (sax != NULL) {
- memset(sax, 0, sizeof(sax));
+ memset(sax, 0, sizeof(*sax));
sax->sax25_family = AF_NETROM;
skb_copy_from_linear_data_offset(skb, 7, sax->sax25_call.ax25_call,
AX25_ADDR_LEN);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists