[vlc-devel] New Defects reported by Coverity Scan for vlc
Romain Vimont
rom1v at videolabs.io
Tue Aug 21 10:12:06 CEST 2018
False-positive?
In vlc_list.h:
#define vlc_list_entry_p(node, p, member) \
(0 ? (p) : (void *)(((char *)(node)) - vlc_list_offset_p(p, member)))
Just for info, why "0 ? (p) : XXX" here?
On Tue, Aug 21, 2018 at 04:12:26AM +0000, scan-admin at coverity.com wrote:
> Hi,
>
> Please find the latest report on new defect(s) introduced to vlc found with Coverity Scan.
>
> 4 new defect(s) introduced to vlc found with Coverity Scan.
>
>
> New defect(s) Reported-by: Coverity Scan
> Showing 4 of 4 defect(s)
>
>
> ** CID 1438459: Memory - illegal accesses (UNINIT)
> /home/jenkins/workspace/vlc-nightly/vlc-nightly-coverity-linux-x64_64/src/misc/background_worker.c: 119 in QueueRemoveAll()
>
>
> ________________________________________________________________________________________________________
> *** CID 1438459: Memory - illegal accesses (UNINIT)
> /home/jenkins/workspace/vlc-nightly/vlc-nightly-coverity-linux-x64_64/src/misc/background_worker.c: 119 in QueueRemoveAll()
> 113 }
> 114
> 115 static void QueueRemoveAll(struct background_worker *worker, void *id)
> 116 {
> 117 vlc_assert_locked(&worker->lock);
> 118 struct task *task;
> >>> CID 1438459: Memory - illegal accesses (UNINIT)
> >>> Using uninitialized value "task".
> 119 vlc_list_foreach(task, &worker->queue, node)
> 120 {
> 121 if (!id || task->id == id)
> 122 {
> 123 vlc_list_remove(&task->node);
> 124 task_Destroy(worker, task);
>
> ** CID 1438458: Memory - illegal accesses (UNINIT)
> /home/jenkins/workspace/vlc-nightly/vlc-nightly-coverity-linux-x64_64/src/misc/background_worker.c: 341 in background_worker_RequestProbe()
>
>
> ________________________________________________________________________________________________________
> *** CID 1438458: Memory - illegal accesses (UNINIT)
> /home/jenkins/workspace/vlc-nightly/vlc-nightly-coverity-linux-x64_64/src/misc/background_worker.c: 341 in background_worker_RequestProbe()
> 335
> 336 void background_worker_RequestProbe( struct background_worker* worker )
> 337 {
> 338 vlc_mutex_lock(&worker->lock);
> 339
> 340 struct background_thread *thread;
> >>> CID 1438458: Memory - illegal accesses (UNINIT)
> >>> Using uninitialized value "thread".
> 341 vlc_list_foreach(thread, &worker->threads, node)
> 342 {
> 343 thread->probe = true;
> 344 vlc_cond_signal(&thread->probe_cancel_wait);
> 345 }
> 346
>
> ** CID 1438457: Memory - illegal accesses (UNINIT)
> /home/jenkins/workspace/vlc-nightly/vlc-nightly-coverity-linux-x64_64/src/misc/medialibrary.c: 68 in vlc_ml_event_send()
>
>
> ________________________________________________________________________________________________________
> *** CID 1438457: Memory - illegal accesses (UNINIT)
> /home/jenkins/workspace/vlc-nightly/vlc-nightly-coverity-linux-x64_64/src/misc/medialibrary.c: 68 in vlc_ml_event_send()
> 62
> 63 static void vlc_ml_event_send( vlc_medialibrary_module_t* p_ml, const vlc_ml_event_t* p_event )
> 64 {
> 65 vlc_medialibrary_t* p_priv = ml_priv( p_ml );
> 66 vlc_mutex_lock( &p_priv->lock );
> 67 struct vlc_ml_event_callback_t* p_cb;
> >>> CID 1438457: Memory - illegal accesses (UNINIT)
> >>> Using uninitialized value "p_cb".
> 68 vlc_list_foreach( p_cb, &p_priv->cbs, node )
> 69 {
> 70 p_cb->pf_cb( p_cb->p_data, p_event );
> 71 }
> 72 vlc_mutex_unlock( &p_priv->lock );
> 73 }
>
> ** CID 1438456: Memory - illegal accesses (UNINIT)
> /home/jenkins/workspace/vlc-nightly/vlc-nightly-coverity-linux-x64_64/src/misc/background_worker.c: 319 in BackgroundWorkerCancelLocked()
>
>
> ________________________________________________________________________________________________________
> *** CID 1438456: Memory - illegal accesses (UNINIT)
> /home/jenkins/workspace/vlc-nightly/vlc-nightly-coverity-linux-x64_64/src/misc/background_worker.c: 319 in BackgroundWorkerCancelLocked()
> 313 {
> 314 vlc_assert_locked(&worker->lock);
> 315
> 316 QueueRemoveAll(worker, id);
> 317
> 318 struct background_thread *thread;
> >>> CID 1438456: Memory - illegal accesses (UNINIT)
> >>> Using uninitialized value "thread".
> 319 vlc_list_foreach(thread, &worker->threads, node)
> 320 {
> 321 if (!id || (thread->task && thread->task->id == id && !thread->cancel))
> 322 {
> 323 thread->cancel = true;
> 324 vlc_cond_signal(&thread->probe_cancel_wait);
>
More information about the vlc-devel
mailing list