]> git.alsa-project.org Git - alsa-utils.git/commitdiff
aseqdump: Check the -u option value properly
authorTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2024 15:29:12 +0000 (17:29 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 22 Jul 2024 17:47:02 +0000 (19:47 +0200)
Instead of passing the value as is, check the value passed to -u
option and bail out for bad values.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
seq/aseqdump/aseqdump.c

index 1c968b1cfc058674b4c760cf97b4a864bd97166a..f717557824ad7f3795eee64e0ffe24eaa110c068 100644 (file)
@@ -1086,6 +1086,8 @@ int main(int argc, char *argv[])
                        break;
                case 'u':
                        ump_version = atoi(optarg);
+                       if (ump_version < 0 || ump_version > 2)
+                               fatal("Invalid UMP version %d", ump_version);
                        snd_seq_set_client_midi_version(seq, ump_version);
                        break;
                case 'r':