summaryrefslogtreecommitdiffstats
path: root/target/linux/generic-2.4/patches/222-sound.patch
blob: 889964baef8ad449b2af9dd570309f0d7a0ca06c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Index: linux-2.4.35.4/drivers/sound/sound_core.c
===================================================================
--- linux-2.4.35.4.orig/drivers/sound/sound_core.c	2007-12-15 05:19:38.946640480 +0100
+++ linux-2.4.35.4/drivers/sound/sound_core.c	2007-12-15 05:20:01.199908622 +0100
@@ -174,9 +174,9 @@
 	}
 	
 	if (r == low)
-		sprintf (name_buf, "%s", name);
+		snprintf (name_buf, sizeof(name_buf), "%s", name);
 	else
-		sprintf (name_buf, "%s%d", name, (r - low) / SOUND_STEP);
+		snprintf (name_buf, sizeof(name_buf), "%s%d", name, (r - low) / SOUND_STEP);
 	s->de = devfs_register (devfs_handle, name_buf,
 				DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor,
 				S_IFCHR | mode, fops, NULL);
@@ -507,9 +507,9 @@
 		 *  ALSA toplevel modules for soundcards, thus we need
 		 *  load them at first.	  [Jaroslav Kysela <perex@jcu.cz>]
 		 */
-		sprintf(mod, "sound-slot-%i", unit>>4);
+		snprintf(mod, sizeof(mod), "sound-slot-%i", unit>>4);
 		request_module(mod);
-		sprintf(mod, "sound-service-%i-%i", unit>>4, chain);
+		snprintf(mod, sizeof(mod), "sound-service-%i-%i", unit>>4, chain);
 		request_module(mod);
 		spin_lock(&sound_loader_lock);
 		s = __look_for_unit(chain, unit);