u-boot/board/gdsys/a38x
Vladimir Oltean 61efbece57 board: gdsys: a38x: 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
..
controlcenterdc.c tpm: Switch TPMv1 over to use the new API 2021-03-02 15:53:37 -05:00
dt_helpers.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dt_helpers.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
hre.c tpm: Switch TPMv1 over to use the new API 2021-03-02 15:53:37 -05:00
hre.h tpm: Convert to use a device parameter 2018-11-29 09:30:06 -07:00
hydra.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
hydra.h arm: mvebu: Add gdsys ControlCenter-Compact board 2017-03-23 15:48:28 +01:00
ihs_phys.c board: gdsys: a38x: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation 2021-09-28 18:50:56 +03:00
ihs_phys.h arm: mvebu: Add gdsys ControlCenter-Compact board 2017-03-23 15:48:28 +01:00
keyprogram.c tpm: Switch TPMv1 over to use the new API 2021-03-02 15:53:37 -05:00
keyprogram.h tpm: Convert to use a device parameter 2018-11-29 09:30:06 -07:00
MAINTAINERS treewide: Fix gdsys mail addresses 2018-03-09 09:23:10 -05:00
Makefile arm: mvebu: gdsys: Remove custom spl_board_init() 2021-07-31 09:59:58 +02:00