Skip to content

Commit c802d75

Browse files
Wei Yongjundavem330
authored andcommitted
netrom: fix invalid use of sizeof in nr_recvmsg()
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@trendmicro.com.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 65d8013 commit c802d75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netrom/af_netrom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
11731173
}
11741174

11751175
if (sax != NULL) {
1176-
memset(sax, 0, sizeof(sax));
1176+
memset(sax, 0, sizeof(*sax));
11771177
sax->sax25_family = AF_NETROM;
11781178
skb_copy_from_linear_data_offset(skb, 7, sax->sax25_call.ax25_call,
11791179
AX25_ADDR_LEN);

0 commit comments

Comments
 (0)