summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lijuan Gao <quic_lijuang@quicinc.com> 2022-01-21 17:11:26 +0800
committer Michael Bestas <mkbestas@lineageos.org> 2025-06-15 18:57:38 +0300
commit2db1a8ae37702192cd061b8736600284548183b6 (patch)
tree87159293265419a8f011c394ddd4a251adb3fab7
parent68dc5cbc945ebc4b3f322684c73ae9851807c256 (diff)
libfdt: Correct the string size while renaming fragments in property
Copy the actual string size instead of the rest of property size when converting property value from fragment@M to fragment@M+delta, it maybe overwrite the next node value. Change-Id: I9ce2f0ea7a4b83cac5f7a7c9bd0c63eb229bf761 Signed-off-by: Lijuan Gao <quic_lijuang@quicinc.com>
-rw-r--r--libfdt/fdt_overlay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libfdt/fdt_overlay.c b/libfdt/fdt_overlay.c
index 531294c..52eabd1 100644
--- a/libfdt/fdt_overlay.c
+++ b/libfdt/fdt_overlay.c
@@ -1232,7 +1232,6 @@ static int rename_fragments_in_property(void *fdto, int offset,
ret = fdt_setprop_placeholder(fdto, offset, label, needed, &p);
if (ret < 0)
return ret;
- len = needed;
}
start = p;
@@ -1262,6 +1261,7 @@ static int rename_fragments_in_property(void *fdto, int offset,
if (available < needed) {
diff = needed - available;
memmove(stop + diff, stop, (end - stop));
+ end += diff;
}
{