222-sound.patch 1.2 KB

12345678910111213141516171819202122232425262728
  1. Index: linux-2.4.35.4/drivers/sound/sound_core.c
  2. ===================================================================
  3. --- linux-2.4.35.4.orig/drivers/sound/sound_core.c
  4. +++ linux-2.4.35.4/drivers/sound/sound_core.c
  5. @@ -174,9 +174,9 @@ static int sound_insert_unit(struct soun
  6. }
  7. if (r == low)
  8. - sprintf (name_buf, "%s", name);
  9. + snprintf (name_buf, sizeof(name_buf), "%s", name);
  10. else
  11. - sprintf (name_buf, "%s%d", name, (r - low) / SOUND_STEP);
  12. + snprintf (name_buf, sizeof(name_buf), "%s%d", name, (r - low) / SOUND_STEP);
  13. s->de = devfs_register (devfs_handle, name_buf,
  14. DEVFS_FL_NONE, SOUND_MAJOR, s->unit_minor,
  15. S_IFCHR | mode, fops, NULL);
  16. @@ -507,9 +507,9 @@ int soundcore_open(struct inode *inode,
  17. * ALSA toplevel modules for soundcards, thus we need
  18. * load them at first. [Jaroslav Kysela <[email protected]>]
  19. */
  20. - sprintf(mod, "sound-slot-%i", unit>>4);
  21. + snprintf(mod, sizeof(mod), "sound-slot-%i", unit>>4);
  22. request_module(mod);
  23. - sprintf(mod, "sound-service-%i-%i", unit>>4, chain);
  24. + snprintf(mod, sizeof(mod), "sound-service-%i-%i", unit>>4, chain);
  25. request_module(mod);
  26. spin_lock(&sound_loader_lock);
  27. s = __look_for_unit(chain, unit);