diff options
| author | David Laight <david.laight.linux@gmail.com> | 2026-06-08 19:51:21 +0100 |
|---|---|---|
| committer | Rob Herring (Arm) <robh@kernel.org> | 2026-06-10 13:48:40 -0500 |
| commit | af96a303789410bb3face6b16bd9b9090ddfeec1 (patch) | |
| tree | e9f94cf83f93766c51bbedc605f2eb3112384d80 /drivers/of | |
| parent | efb6347d8b43d4d516a8f937485af29357c31df2 (diff) | |
| download | linux-next-af96a303789410bb3face6b16bd9b9090ddfeec1.tar.gz linux-next-af96a303789410bb3face6b16bd9b9090ddfeec1.zip | |
drivers/of/overlay: Use memcpy() to copy known length strings
Avoid calls to strcpy().
The lengths of the strings have been used for the kzalloc(), replace
the strcpy() calls with memcpy() using the known lengths.
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Link: https://patch.msgid.link/20260608185121.22331-1-david.laight.linux@gmail.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Diffstat (limited to 'drivers/of')
| -rw-r--r-- | drivers/of/overlay.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index c1c5686fc7b1..656867009514 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -258,8 +258,8 @@ static struct property *dup_and_fixup_symbol_prop( if (!new_prop->name || !new_prop->value) goto err_free_new_prop; - strcpy(new_prop->value, target_path); - strcpy(new_prop->value + target_path_len, path_tail); + memcpy(new_prop->value, target_path, target_path_len); + memcpy(new_prop->value + target_path_len, path_tail, path_tail_len); of_property_set_flag(new_prop, OF_DYNAMIC); |
