diff options
| author | Francois Berder <[email protected]> | 2026-05-18 16:39:27 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-05-29 14:23:11 -0600 |
| commit | c39e0e257c931c1cb03613f46b01e4db6cc0d44b (patch) | |
| tree | 1f0822e7f46b9af0707b97c90e3405616c7e330f /boot | |
| parent | 9f00cec3d834f259a22eaca3e1e1f74365509aec (diff) | |
boot: cedit: Check ofnode_read_prop return value
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/cedit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/boot/cedit.c b/boot/cedit.c index 56dc7c6af15..b1b79d1752a 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", -ENOENT); if (len >= tline->max_chars) return log_msg_ret("str", -ENOSPC); strcpy(abuf_data(&tline->buf), val); |
