Skip to content

Commit da5ac77

Browse files
keesdavem330
authored andcommitted
r8169: Avoid memcpy() over-reading of ETH_SS_STATS
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally reading across neighboring array fields. The memcpy() is copying the entire structure, not just the first array. Adjust the source argument so the compiler can do appropriate bounds checking. Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 224004f commit da5ac77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
16711671
{
16721672
switch(stringset) {
16731673
case ETH_SS_STATS:
1674-
memcpy(data, *rtl8169_gstrings, sizeof(rtl8169_gstrings));
1674+
memcpy(data, rtl8169_gstrings, sizeof(rtl8169_gstrings));
16751675
break;
16761676
}
16771677
}

0 commit comments

Comments
 (0)