From: <dg...@us...> - 2006-09-26 22:03:46
|
Update of /cvsroot/xine/xine-lib/src/xine-engine In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv18680 Modified Files: events.c Log Message: Make sure that no possibly NULL pointer is dereferenced. Found by Coverity Scan CID 248. Index: events.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/xine-engine/events.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- events.c 27 Jan 2006 19:49:23 -0000 1.30 +++ events.c 26 Sep 2006 22:03:44 -0000 1.31 @@ -142,14 +142,17 @@ pthread_mutex_lock (&stream->event_queues_lock); ite = xine_list_front (stream->event_queues); - q = xine_list_get_value (stream->event_queues, ite); - while (ite && (q != queue)) { - ite = xine_list_next (stream->event_queues, ite); - q = xine_list_get_value (stream->event_queues, ite); + if ( ite ) { + do { + q = xine_list_get_value (stream->event_queues, ite); + + if ( q == queue ) + break; + } while( (ite = xine_list_next (stream->event_queues, ite)) ); } - if (!q) { + if (q != queue) { xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "events: tried to dispose queue which is not in list\n"); pthread_mutex_unlock (&stream->event_queues_lock); |