[alsa-devel] coverity fix in alsa-libs

Takashi Iwai tiwai at suse.de
Mon Sep 15 13:48:11 CEST 2014


At Mon, 15 Sep 2014 17:36:02 +0600,
Alexander E. Patrakov wrote:
> 
> 15.09.2014 15:25, Renu Tyagi wrote:
> > Hi,
> >
> > I ran Coverity analysis tool on alsa and found some bugs.
> 
> May I suggest that we remove aserver and the shm plugin instead of 
> applying the patch? Three days ago I tried to use it for testing my fix 
> to the share plugin, but failed. In other words: if even speaker-test 
> cannot be made to work on it without crashing and/or hanging or valgrind 
> errors, then I'd rather be aggressive here.
> 
> And next time please CC: Takashi Iwai on all alsa-lib patches :)

I'm for removing aserver & co, too, but let's put it as post-1.0.29
item, since Jaroslav seems preparing 1.0.29 release now.


thanks,

Takashi

> 
> > Bug and Patch description
> >
> > 1. Changed file  :  aserver.c
> > Socket not closed before returning when bind fails
> > Community Code:
> >
> > if (bind(sock, (struct sockaddr *) addr, size) < 0) {
> > int result = -errno;
> > SYSERROR("bind failed");
> > return result;
> > }
> > return sock;
> > }
> >
> > Recommended Code :
> >
> > if (bind(sock, (struct sockaddr *) addr, size) < 0) {
> > 	int result = -errno;
> > 	SYSERROR("bind failed");
> > 	close(sock);
> > 	return result;
> > }
> > return sock;
> > }
> >
> > 2.Changed file : control_shm.c
> > Socket not closed before returning when connect fails
> >
> > Community Code:
> > if (connect(sock, (struct sockaddr *) addr, size) < 0)
> >      return -errno;
> > 	return sock;
> > }
> >
> > Recommended Code :
> > if (connect(sock, (struct sockaddr *) addr, size) < 0){
> >      SYSERR("connect failed");
> >      close(sock);
> >      return -errno;
> > 	}
> > return sock;
> > }
> >
> > 3.Changed file : pcm_shm.c
> > Socket not closed before returning when connect fails
> >
> > Community Code:
> > if (connect(sock, (struct sockaddr *) addr, size) < 0) {
> >     SYSERR("connect failed");
> > 	return -errno;
> >     }
> >   return sock;
> > }
> > Recommended Code :
> > if (connect(sock, (struct sockaddr *) addr, size) < 0) {
> >   SYSERR("connect failed");
> >   close(sock);
> >   return -errno;
> >   }
> > return sock;
> > }
> >
> > PFA patch.
> >
> >
> >
> >
> >
> > Thanks & Regards,
> >
> > Renu Tyagi
> >
> >
> >
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel at alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> >
> 
> 
> -- 
> Alexander E. Patrakov
> 


More information about the Alsa-devel mailing list