u-boot/drivers/net/ti
Vladimir Oltean fe04172479 net: davinci_emac: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation
strncpy() simply bails out when copying a source string whose size
exceeds the destination string size, potentially leaving the destination
string unterminated.

One possible way to address is to pass MDIO_NAME_LEN - 1 and a
previously zero-initialized destination string, but this is more
difficult to maintain.

The chosen alternative is to use strlcpy(), which properly limits the
copy len in the (srclen >= size) case to "size - 1", and which is also
more efficient than the strncpy() byte-by-byte implementation by using
memcpy. The destination string returned by strlcpy() is always NULL
terminated.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-09-28 18:50:56 +03:00
..
am65-cpsw-nuss.c net: ti: am65-cpsw-nuss: Add a new compatible for AM64 2021-05-12 16:36:39 +05:30
cpsw-common.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
cpsw.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
cpsw_mdio.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
cpsw_mdio.h driver: net: ti: cpsw-mdio: use phys_addr_t for mdio_base addr 2019-07-15 13:32:25 -05:00
davinci_emac.c net: davinci_emac: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation 2021-09-28 18:50:56 +03:00
davinci_emac.h driver: net: consolidate ti's code in separate folder 2018-11-05 10:41:59 -06:00
Kconfig Convert CONFIG_DRIVER_TI_EMAC_USE_RMII to Kconfig 2020-07-28 16:18:10 -04:00
keystone_net.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
Makefile net: ethernet: ti: Introduce am654 gigabit eth switch subsystem driver 2019-07-15 13:32:25 -05:00