Skip to content
Snippets Groups Projects
Commit 4991b4f7 authored by Mario Six's avatar Mario Six Committed by Stefan Roese
Browse files

tools: kwbimage: Refactor line parsing and fix error


The function image_create_config_parse_oneline is pretty complex, and
since more parameters will be added to support secure booting, we
refactor the function to make it more readable.

Also, when a line contained just a keyword without any parameters,
strtok_r returned NULL, which was then indiscriminately fed into atoi,
causing a segfault. To correct this, we add a NULL check before feeding
the extracted token to atoi, and print an error message in case the
token is NULL.

Signed-off-by: default avatarMario Six <mario.six@gdsys.cc>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
parent 79066ef8
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment