ucm: fix possible NULL pointer dereference in uc_mgr_exec()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-06-02 19:58:04 +02:00
parent 7fcb1aadd5
commit 26ab7fc3e4

View file

@ -185,7 +185,11 @@ int uc_mgr_exec(const char *prog)
return -EINVAL; return -EINVAL;
prog = argv[0]; prog = argv[0];
if (argv[0][0] != '/' && argv[0][0] != '.') { if (prog == NULL) {
err = -EINVAL;
goto __error;
}
if (prog[0] != '/' && prog[0] != '.') {
if (!find_exec(argv[0], bin, sizeof(bin))) { if (!find_exec(argv[0], bin, sizeof(bin))) {
err = -ENOEXEC; err = -ENOEXEC;
goto __error; goto __error;