Skip to contentSkip to conversation

NULL pointer dereference in sound/synth/emux/soundfont.c

PATCH In review Eric Sesterhenn 2 participants 2 messages May 30, 2006 – May 31, 2006 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NULL pointer dereference in sound/synth/emux/soundfont.c

hi,

this is about coverity id #100.
It seems the if statement is negated, since the else branch calls remove_info() with sflist->currsf as a parameter where it gets dereferenced.

sound/synth/emux/soundfont.c renamed from sound/synth/emux/soundfont.c.orig +1 -1
@@ -195,7 +195,7 @@ snd_soundfont_load(struct snd_sf_list *s
 		break;
 	case SNDRV_SFNT_REMOVE_INFO:
 		/* patch must be opened */
-		if (sflist->currsf) {
+		if (!sflist->currsf) {
 			snd_printk("soundfont: remove_info: patch not opened\n");
 			rc = -EINVAL;
 		} else {
#1 lore raw

At Tue, 30 May 2006 22:18:16 +0200,

Quoted 9 lines · Eric Sesterhenn

hi,

this is about coverity id #100.
It seems the if statement is negated, since the else branch calls remove_info() with sflist->currsf as a parameter where it gets dereferenced.

Thanks, I applied it to ALSA tree.

Takashi

Quoted 14 lines
sound/synth/emux/soundfont.c renamed from sound/synth/emux/soundfont.c.orig +1 -1
@@ -195,7 +195,7 @@ snd_soundfont_load(struct snd_sf_list *s
 		break;
 	case SNDRV_SFNT_REMOVE_INFO:
 		/* patch must be opened */
-		if (sflist->currsf) {
+		if (!sflist->currsf) {
 			snd_printk("soundfont: remove_info: patch not opened\n");
 			rc = -EINVAL;
 		} else {