[alsa-devel] coverity fix in alsa-libs
Hi,
I ran Coverity analysis tool on alsa and found some bugs. 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
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
- 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@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
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
- 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@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
-- Alexander E. Patrakov
At Mon, 15 Sep 2014 13:48:11 +0200, Takashi Iwai wrote:
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.
BTW, I haven't received the original mail from ML server. (The delivery seems slowed down by some reason, so it might be that, though...)
Takashi
participants (3)
-
Alexander E. Patrakov
-
Renu Tyagi
-
Takashi Iwai