mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
mkimage: error handling for FIT image
If parameter -F is given but FIT support is missing, a NULL pointer might dereferenced (Coverity CID 350249). If incorrect parameters are given, provide a message and show usage. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
55fd1c442e
commit
5017f9b595
1 changed files with 6 additions and 1 deletions
|
@ -381,6 +381,11 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
if (params.fflag){
|
||||
if (!tparams) {
|
||||
fprintf(stderr, "%s: Missing FIT support\n",
|
||||
params.cmdname);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (tparams->fflag_handle)
|
||||
/*
|
||||
* in some cases, some additional processing needs
|
||||
|
@ -391,7 +396,7 @@ int main(int argc, char **argv)
|
|||
retval = tparams->fflag_handle(¶ms);
|
||||
|
||||
if (retval != EXIT_SUCCESS)
|
||||
exit (retval);
|
||||
usage("Bad parameters for FIT image type");
|
||||
}
|
||||
|
||||
if (params.lflag || params.fflag) {
|
||||
|
|
Loading…
Reference in a new issue