ALSA: hda - Use snprintf() to be safer
authorTakashi Iwai <tiwai@suse.de>
Wed, 22 Jul 2009 14:02:46 +0000 (16:02 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 22 Jul 2009 14:02:46 +0000 (16:02 +0200)
Use snprint() for creating the jack name string instead of sprintf()
in patch_sigmatel.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_sigmatel.c

index da7f9f65c04781ab0577cf62af8a05a006909126..512f3b9b9a459e27450efad9cb8c875823a99496 100644 (file)
@@ -4066,7 +4066,7 @@ static int stac92xx_add_jack(struct hda_codec *codec,
        jack->nid = nid;
        jack->type = type;
 
-       sprintf(name, "%s at %s %s Jack",
+       snprintf(name, sizeof(name), "%s at %s %s Jack",
                snd_hda_get_jack_type(def_conf),
                snd_hda_get_jack_connectivity(def_conf),
                snd_hda_get_jack_location(def_conf));