]> git.baikalelectronics.ru Git - uboot.git/commit
cmd: fdt: Fix iteration over elements above index 1 in fdt get
authorMarek Vasut <marex@denx.de>
Mon, 14 Nov 2022 21:49:59 +0000 (22:49 +0100)
committerSimon Glass <sjg@chromium.org>
Tue, 22 Nov 2022 22:13:35 +0000 (15:13 -0700)
commit4c15501a94689024bbedbcac246381ec25f70785
tree19e3af873b6f7c19eaa564a9c463af1baf3a0113
parenta7a572129023f8c8f4c410e307e4a79f1395f879
cmd: fdt: Fix iteration over elements above index 1 in fdt get

Always increment both the iterator and pointer into the string
property value by length of the current element + 1 (to cater
for the string delimiter), otherwise the element extracted from
the string property value would be extracted from an offset that
is multiple of the length of the first element, instead of sum
of element lengths until select index.

This fixes 'fdt get value' operation for index above 1 (counting
from index 0).

Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fixes: 56bdc6d76f7 ("cmd: fdt: Add support for reading stringlist property values")
Signed-off-by: Marek Vasut <marex@denx.de>
cmd/fdt.c