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>
This commit is contained in:
parent
94542992b1
commit
3cc0eabfe9
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue