Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae428655 authored by Nickolai Zeldovich's avatar Nickolai Zeldovich Committed by Greg Kroah-Hartman
Browse files

staging: speakup: avoid out-of-range access in synth_init()



Check that array index is in-bounds before accessing the synths[] array.

Signed-off-by: default avatarNickolai Zeldovich <nickolai@csail.mit.edu>
Cc: stable <stable@vger.kernel.org>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2dcb4a29
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ int synth_init(char *synth_name)

	mutex_lock(&spk_mutex);
	/* First, check if we already have it loaded. */
	for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++)
	for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++)
		if (strcmp(synths[i]->name, synth_name) == 0)
			synth = synths[i];