diff mbox series

[alsa-utils,06/10] aseqdump: Check the -u option value properly

Message ID 20240722175215.8223-7-tiwai@suse.de
State New
Headers show
Series Cleanup seq/* stuff and extend aseqsend | expand

Commit Message

Takashi Iwai July 22, 2024, 5:52 p.m. UTC
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 | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/seq/aseqdump/aseqdump.c b/seq/aseqdump/aseqdump.c
index 1c968b1cfc05..f717557824ad 100644
--- a/seq/aseqdump/aseqdump.c
+++ b/seq/aseqdump/aseqdump.c
@@ -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':