Skip to content

Commit 217bfbb

Browse files
committed
ALSA: seq: oss: Fix missing error check in snd_seq_oss_synth_make_info()
snd_seq_oss_synth_make_info() didn't check the error code from snd_seq_oss_midi_make_info(), and this leads to the call of strlcpy() with the uninitialized string as the source, which may lead to the access over the limit. Add the proper error check for avoiding the failure. Reported-by: [email protected] Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 67ea698 commit 217bfbb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/core/seq/oss/seq_oss_synth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,8 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in
611611

612612
if (info->is_midi) {
613613
struct midi_info minf;
614-
snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf);
614+
if (snd_seq_oss_midi_make_info(dp, info->midi_mapped, &minf))
615+
return -ENXIO;
615616
inf->synth_type = SYNTH_TYPE_MIDI;
616617
inf->synth_subtype = 0;
617618
inf->nr_voices = 16;

0 commit comments

Comments
 (0)