public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] ALSA: firewire-tascam: off by one in identify_model()
@ 2015-10-15 18:18 Dan Carpenter
  2015-10-17 10:11 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2015-10-15 18:18 UTC (permalink / raw)
  To: Clemens Ladisch, Takashi Sakamoto
  Cc: Jaroslav Kysela, Takashi Iwai, alsa-devel, kernel-janitors

In the original code, we potentially put a NUL character in model[8] and
it caused a static checker warning.  We can put the NUL in model[7]
instead.

Fixes: 53b3ffee7885 ('ALSA: firewire-tascam: change device probing processing')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/sound/firewire/tascam/tascam.c b/sound/firewire/tascam/tascam.c
index c6747a4..6ef2bcc 100644
--- a/sound/firewire/tascam/tascam.c
+++ b/sound/firewire/tascam/tascam.c
@@ -51,7 +51,7 @@ static int identify_model(struct snd_tscm *tscm)
 	}
 
 	/* Pick up model name from certain addresses. */
-	for (i = 0; i < 8; i++) {
+	for (i = 0; i < 7; i++) {
 		c = config_rom[28 + i / 4] >> (24 - 8 * (i % 4));
 		if (c = '\0')
 			break;

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-19 12:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15 18:18 [patch] ALSA: firewire-tascam: off by one in identify_model() Dan Carpenter
2015-10-17 10:11 ` Takashi Iwai
2015-10-17 12:02   ` Dan Carpenter
2015-10-18  1:00     ` Takashi Sakamoto
2015-10-19 11:29       ` [patch v2] " Dan Carpenter
2015-10-19 11:54         ` Takashi Sakamoto
2015-10-19 12:01         ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox