[alsa-devel] coverity fix in alsa-libs
Alexander E. Patrakov
patrakov at gmail.com
Mon Sep 15 13:36:02 CEST 2014
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 :)
> 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