[PATCH] boot: cedit: Check ofnode_read_prop return value
Francois Berder
fberder at outlook.fr
Fri May 15 22:57:47 CEST 2026
In h_read_settings, val variable could be NULL due to
ofnode_read_prop returning an error. This variable
would then be used as the src in strcpy.
Add a NULL check after calling ofnode_read_prop.
Signed-off-by: Francois Berder <fberder at outlook.fr>
---
boot/cedit.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/boot/cedit.c b/boot/cedit.c
index 56dc7c6af15..49155b42961 100644
--- a/boot/cedit.c
+++ b/boot/cedit.c
@@ -500,6 +500,8 @@ static int h_read_settings(struct scene_obj *obj, void *vpriv)
tline = (struct scene_obj_textline *)obj;
val = ofnode_read_prop(node, obj->name, &len);
+ if (!val)
+ return log_msg_ret("tline", -EINVAL);
if (len >= tline->max_chars)
return log_msg_ret("str", -ENOSPC);
strcpy(abuf_data(&tline->buf), val);
--
2.43.0
More information about the U-Boot
mailing list