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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 seq/aseqdump/aseqdump.c | 2 ++
 1 file changed, 2 insertions(+)

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':
-- 
2.43.0




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux