summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNaveen Kumar Chaudhary <[email protected]>2026-06-26 09:18:02 +0530
committerTom Rini <[email protected]>2026-07-10 15:52:16 -0600
commitb81e716b263479e7e2194f9a2df3c04c83307545 (patch)
tree00900091156cdaca18defa2b1fde3528419105aa /include
parent9df08fb181de1c02eec2d74096e14252d779a134 (diff)
cmd: ini: avoid NULL deref when loadaddr/filesize env vars are unset
When the user runs "ini <section>" without explicit address or size arguments, do_ini() falls back to env_get("loadaddr") and env_get("filesize") and passes the results straight to hextoul(). env_get() returns NULL for an undefined variable and hextoul() does not tolerate a NULL pointer, so on a board without these variables set the command dereferences NULL. Fetch the strings into locals first, reject the NULL case with CMD_RET_USAGE, and only then convert to numeric values. Fixes: c167cc02033 ("Add a new "ini" command") Signed-off-by: Naveen Kumar Chaudhary <[email protected]>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions