]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: fix possible NULL pointer dereference in uc_mgr_exec()
authorJaroslav Kysela <perex@perex.cz>
Wed, 2 Jun 2021 17:58:04 +0000 (19:58 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 2 Jun 2021 17:58:04 +0000 (19:58 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/ucm_exec.c

index 1cdb263371adea9cf19488881135f97b212d06be..d83206d0ba330e1a7caf687f1ccc830a79cc511d 100644 (file)
@@ -185,7 +185,11 @@ int uc_mgr_exec(const char *prog)
                return -EINVAL;
 
        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))) {
                        err = -ENOEXEC;
                        goto __error;