[pulseaudio-discuss] [PATCH 1/8] raop: Fix potential dereference after NULL check

Peter Meerwald-Stadler pmeerw at pmeerw.net
Wed Mar 8 15:09:32 UTC 2017


Coverity ID: #1398157

Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
---
 src/modules/raop/raop-sink.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/modules/raop/raop-sink.c b/src/modules/raop/raop-sink.c
index c5ff8b9..4ca625f 100644
--- a/src/modules/raop/raop-sink.c
+++ b/src/modules/raop/raop-sink.c
@@ -246,10 +246,12 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
 
                     if (u->rtpoll_item) {
                         pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, &nbfds);
-                        for (i = 0; i < nbfds; i++) {
-                            if (pollfd && pollfd->fd >= 0)
-                               pa_close(pollfd->fd);
-                            pollfd++;
+                        if (pollfd) {
+                            for (i = 0; i < nbfds; i++) {
+                                if (pollfd->fd >= 0)
+                                   pa_close(pollfd->fd);
+                                pollfd++;
+                            }
                         }
                         pa_rtpoll_item_free(u->rtpoll_item);
                         u->rtpoll_item = NULL;
-- 
2.7.4



More information about the pulseaudio-discuss mailing list