u-boot/arch
Vladimir Oltean fca315a382 arch: powerpc: mpc85xx: 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
..
arc global_data: Ensure we have <config.h> when symbols are not in Kconfig yet 2021-06-23 08:45:03 -04:00
arm net: freescale: replace usage of phy-mode = "sgmii-2500" with "2500base-x" 2021-09-28 18:50:56 +03:00
m68k m68k: Remove M52277EVB board 2021-07-18 21:03:57 -04:00
microblaze lmb: move CONFIG_LMB in Kconfig 2021-04-22 14:09:45 -04:00
mips pci: Drop DM_PCI 2021-09-13 18:23:13 -04:00
nds32 pci: ppc: Drop ftpci100 driver 2021-08-06 08:26:48 -04:00
nios2 global: Convert simple_strtoul() with hex to hextoul() 2021-08-02 13:32:14 -04:00
powerpc arch: powerpc: mpc85xx: ensure mdiodev->name is NULL terminated after MDIO_NAME_LEN truncation 2021-09-28 18:50:56 +03:00
riscv riscv: lib: modify the indent 2021-09-07 10:34:29 +08:00
sandbox bootcount: add a new driver with syscon as backend 2021-08-22 11:04:52 +02:00
sh global: Convert simple_strtoul() with hex to hextoul() 2021-08-02 13:32:14 -04:00
x86 x86: tangier: acpi: Add GPIO card detection to SDHCI #2 2021-09-28 18:50:55 +03:00
xtensa treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
.gitignore
Kconfig pci: Drop DM_PCI 2021-09-13 18:23:13 -04:00
u-boot-elf.lds arch: Add explicit linker script for u-boot-elf 2020-04-03 11:52:55 -04:00