New Defects reported by Coverity Scan for LibreOffice
scan-admin at coverity.com
scan-admin at coverity.com
Fri Oct 4 03:04:35 UTC 2024
Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.
13 new defect(s) introduced to LibreOffice found with Coverity Scan.
24 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 13 of 13 defect(s)
** CID 1620551: (UNINIT)
________________________________________________________________________________________________________
*** CID 1620551: (UNINIT)
/ucb/source/cacher/dynamicresultsetwrapper.cxx: 333 in DynamicResultSetWrapper::setListener(const com::sun::star::uno::Reference<com::sun::star::ucb::XDynamicResultSetListener> &)()
327 if( m_xListener.is() )
328 throw ListenerAlreadySetException();
329 if( m_bStatic )
330 throw ListenerAlreadySetException();
331
332 m_xListener = Listener;
>>> CID 1620551: (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "addInterface".
333 m_aDisposeEventListeners.addInterface( aGuard, Listener );
334
335 Reference< XDynamicResultSet > xSource = m_xSource;
336 Reference< XDynamicResultSetListener > xMyListenerImpl = m_xMyListenerImpl;
337
338 aGuard.unlock();
/ucb/source/cacher/dynamicresultsetwrapper.cxx: 338 in DynamicResultSetWrapper::setListener(const com::sun::star::uno::Reference<com::sun::star::ucb::XDynamicResultSetListener> &)()
332 m_xListener = Listener;
333 m_aDisposeEventListeners.addInterface( aGuard, Listener );
334
335 Reference< XDynamicResultSet > xSource = m_xSource;
336 Reference< XDynamicResultSetListener > xMyListenerImpl = m_xMyListenerImpl;
337
>>> CID 1620551: (UNINIT)
>>> Using uninitialized value "aGuard._M_device" when calling "unlock".
338 aGuard.unlock();
339
340 if ( xSource.is() )
341 xSource->setListener( xMyListenerImpl );
342
343 m_aListenerSet.set();
** CID 1620550: Memory - illegal accesses (UNINIT)
________________________________________________________________________________________________________
*** CID 1620550: Memory - illegal accesses (UNINIT)
/ucb/source/cacher/dynamicresultsetwrapper.cxx: 305 in DynamicResultSetWrapper::getStaticResultSet()()
299 throw ListenerAlreadySetException();
300
301 Reference< XDynamicResultSet > xSource = m_xSource;
302 Reference< XEventListener > xMyListenerImpl = m_xMyListenerImpl;
303 m_bStatic = true;
304
>>> CID 1620550: Memory - illegal accesses (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "unlock".
305 aGuard.unlock();
306
307 if( xSource.is() )
308 {
309 xSource->addEventListener( xMyListenerImpl );
310 }
** CID 1620549: (UNINIT)
________________________________________________________________________________________________________
*** CID 1620549: (UNINIT)
/ucb/source/ucp/file/filrset.cxx: 238 in fileaccess::XResultSet_impl::next()()
232 XResultSet_impl::next()
233 {
234 std::unique_lock aGuard( m_aMutex );
235 bool test;
236 if( ++m_nRow < sal::static_int_cast<sal_Int32>(m_aItems.size()) ) test = true;
237 else
>>> CID 1620549: (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "OneMore".
238 test = OneMore(aGuard);
239 return test;
240 }
241
242
243 sal_Bool SAL_CALL
/ucb/source/ucp/file/filrset.cxx: 238 in fileaccess::XResultSet_impl::next()()
232 XResultSet_impl::next()
233 {
234 std::unique_lock aGuard( m_aMutex );
235 bool test;
236 if( ++m_nRow < sal::static_int_cast<sal_Int32>(m_aItems.size()) ) test = true;
237 else
>>> CID 1620549: (UNINIT)
>>> Using uninitialized value "aGuard._M_device" when calling "OneMore".
238 test = OneMore(aGuard);
239 return test;
240 }
241
242
243 sal_Bool SAL_CALL
** CID 1620548: Memory - illegal accesses (UNINIT)
________________________________________________________________________________________________________
*** CID 1620548: Memory - illegal accesses (UNINIT)
/vcl/source/window/dndlistenercontainer.cxx: 391 in DNDListenerContainer::acceptDrag(signed char)()
385 void SAL_CALL DNDListenerContainer::acceptDrag( sal_Int8 dragOperation )
386 {
387 std::unique_lock g(m_aMutex);
388 if( !m_xDropTargetDragContext )
389 return;
390 auto xTmpDragContext = std::move(m_xDropTargetDragContext);
>>> CID 1620548: Memory - illegal accesses (UNINIT)
>>> Using uninitialized value "g._M_owns" when calling "unlock".
391 g.unlock();
392 xTmpDragContext->acceptDrag( dragOperation );
393 }
394
395 void SAL_CALL DNDListenerContainer::rejectDrag( )
396 {
** CID 1620547: Memory - illegal accesses (UNINIT)
________________________________________________________________________________________________________
*** CID 1620547: Memory - illegal accesses (UNINIT)
/ucb/source/cacher/dynamicresultsetwrapper.cxx: 241 in DynamicResultSetWrapper::impl_notify(const com::sun::star::ucb::ListEvent &)()
235 break;
236 }
237 }
238 }
239 OSL_ENSURE( m_bGotWelcome, "first notification was without WELCOME" );
240
>>> CID 1620547: Memory - illegal accesses (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "unlock".
241 aGuard.unlock();
242
243 if( !m_xListener.is() )
244 m_aListenerSet.wait();
245 m_xListener->notify( aNewEvent );
246
** CID 1620546: (UNINIT)
________________________________________________________________________________________________________
*** CID 1620546: (UNINIT)
/ucb/source/ucp/file/filrset.cxx: 269 in fileaccess::XResultSet_impl::isLast()()
263
264 sal_Bool SAL_CALL
265 XResultSet_impl::isLast()
266 {
267 std::unique_lock aGuard( m_aMutex );
268 if( m_nRow == sal::static_int_cast<sal_Int32>(m_aItems.size()) - 1 )
>>> CID 1620546: (UNINIT)
>>> Using uninitialized value "aGuard._M_device" when calling "OneMore".
269 return ! OneMore(aGuard);
270 else
271 return false;
272 }
273
274
/ucb/source/ucp/file/filrset.cxx: 269 in fileaccess::XResultSet_impl::isLast()()
263
264 sal_Bool SAL_CALL
265 XResultSet_impl::isLast()
266 {
267 std::unique_lock aGuard( m_aMutex );
268 if( m_nRow == sal::static_int_cast<sal_Int32>(m_aItems.size()) - 1 )
>>> CID 1620546: (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "OneMore".
269 return ! OneMore(aGuard);
270 else
271 return false;
272 }
273
274
** CID 1620545: Memory - illegal accesses (UNINIT)
________________________________________________________________________________________________________
*** CID 1620545: Memory - illegal accesses (UNINIT)
/ucb/source/cacher/dynamicresultsetwrapper.cxx: 356 in DynamicResultSetWrapper::connectToCache(const com::sun::star::uno::Reference<com::sun::star::ucb::XDynamicResultSet> &)()
350 impl_EnsureNotDisposed(aGuard);
351
352 if( m_xListener.is() )
353 throw ListenerAlreadySetException();
354 if( m_bStatic )
355 throw ListenerAlreadySetException();
>>> CID 1620545: Memory - illegal accesses (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "unlock".
356 aGuard.unlock();
357
358 Reference< XSourceInitialization > xTarget( xCache, UNO_QUERY );
359 OSL_ENSURE( xTarget.is(), "The given Target doesn't have the required interface 'XSourceInitialization'" );
360 if( xTarget.is() && m_xContext.is() )
361 {
** CID 1620544: (UNINIT)
________________________________________________________________________________________________________
*** CID 1620544: (UNINIT)
/ucb/source/ucp/file/filrset.cxx: 329 in fileaccess::XResultSet_impl::absolute(int)()
323 {
324 std::unique_lock aGuard( m_aMutex );
325 if( row >= 0 )
326 {
327 m_nRow = row - 1;
328 if( row >= sal::static_int_cast<sal_Int32>(m_aItems.size()) )
>>> CID 1620544: (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "OneMore".
329 while( row-- && OneMore(aGuard) )
330 ;
331 }
332 else
333 {
334 last();
/ucb/source/ucp/file/filrset.cxx: 329 in fileaccess::XResultSet_impl::absolute(int)()
323 {
324 std::unique_lock aGuard( m_aMutex );
325 if( row >= 0 )
326 {
327 m_nRow = row - 1;
328 if( row >= sal::static_int_cast<sal_Int32>(m_aItems.size()) )
>>> CID 1620544: (UNINIT)
>>> Using uninitialized value "aGuard._M_device" when calling "OneMore".
329 while( row-- && OneMore(aGuard) )
330 ;
331 }
332 else
333 {
334 last();
** CID 1620543: (UNINIT)
________________________________________________________________________________________________________
*** CID 1620543: (UNINIT)
/ucb/source/ucp/file/filrset.cxx: 287 in fileaccess::XResultSet_impl::afterLast()()
281
282 void SAL_CALL
283 XResultSet_impl::afterLast()
284 {
285 std::unique_lock aGuard( m_aMutex );
286 m_nRow = sal::static_int_cast<sal_Int32>(m_aItems.size());
>>> CID 1620543: (UNINIT)
>>> Using uninitialized value "aGuard._M_device" when calling "OneMore".
287 while( OneMore(aGuard) )
288 ++m_nRow;
289 }
290
291
292 sal_Bool SAL_CALL
/ucb/source/ucp/file/filrset.cxx: 287 in fileaccess::XResultSet_impl::afterLast()()
281
282 void SAL_CALL
283 XResultSet_impl::afterLast()
284 {
285 std::unique_lock aGuard( m_aMutex );
286 m_nRow = sal::static_int_cast<sal_Int32>(m_aItems.size());
>>> CID 1620543: (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "OneMore".
287 while( OneMore(aGuard) )
288 ++m_nRow;
289 }
290
291
292 sal_Bool SAL_CALL
** CID 1620542: (UNINIT)
________________________________________________________________________________________________________
*** CID 1620542: (UNINIT)
/ucb/source/ucp/file/filrset.cxx: 411 in fileaccess::XResultSet_impl::close()()
405 XResultSet_impl::close()
406 {
407 std::unique_lock aGuard( m_aMutex );
408 if( m_nIsOpen )
409 {
410 m_aFolder.close();
>>> CID 1620542: (UNINIT)
>>> Using uninitialized value "aGuard._M_device" when calling "isFinalChanged".
411 isFinalChanged(aGuard);
412 m_nIsOpen = false;
413 }
414 }
415
416
/ucb/source/ucp/file/filrset.cxx: 411 in fileaccess::XResultSet_impl::close()()
405 XResultSet_impl::close()
406 {
407 std::unique_lock aGuard( m_aMutex );
408 if( m_nIsOpen )
409 {
410 m_aFolder.close();
>>> CID 1620542: (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "isFinalChanged".
411 isFinalChanged(aGuard);
412 m_nIsOpen = false;
413 }
414 }
415
416
** CID 1620541: (UNINIT)
________________________________________________________________________________________________________
*** CID 1620541: (UNINIT)
/ucb/source/ucp/file/filrset.cxx: 305 in fileaccess::XResultSet_impl::last()()
299
300 sal_Bool SAL_CALL
301 XResultSet_impl::last()
302 {
303 std::unique_lock aGuard( m_aMutex );
304 m_nRow = sal::static_int_cast<sal_Int32>(m_aItems.size()) - 1;
>>> CID 1620541: (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "OneMore".
305 while( OneMore(aGuard) )
306 ++m_nRow;
307 return true;
308 }
309
310
/ucb/source/ucp/file/filrset.cxx: 305 in fileaccess::XResultSet_impl::last()()
299
300 sal_Bool SAL_CALL
301 XResultSet_impl::last()
302 {
303 std::unique_lock aGuard( m_aMutex );
304 m_nRow = sal::static_int_cast<sal_Int32>(m_aItems.size()) - 1;
>>> CID 1620541: (UNINIT)
>>> Using uninitialized value "aGuard._M_device" when calling "OneMore".
305 while( OneMore(aGuard) )
306 ++m_nRow;
307 return true;
308 }
309
310
** CID 1620540: Memory - illegal accesses (UNINIT)
________________________________________________________________________________________________________
*** CID 1620540: Memory - illegal accesses (UNINIT)
/vcl/source/app/session.cxx: 303 in <unnamed>::VCLSession::queryInteraction(const com::sun::star::uno::Reference<com::sun::star::frame::XSessionManagerListener> &)()
297
298 std::unique_lock aGuard( m_aMutex );
299
300 if( m_bInteractionGranted )
301 {
302 bool bInteractionDone = m_bInteractionDone;
>>> CID 1620540: Memory - illegal accesses (UNINIT)
>>> Using uninitialized value "aGuard._M_owns" when calling "unlock".
303 aGuard.unlock();
304
305 if( bInteractionDone )
306 xListener->approveInteraction( false );
307 else
308 xListener->approveInteraction( true );
** CID 1620539: (LOCK_EVASION)
/svx/source/unodraw/unoshcol.cxx: 111 in SvxShapeCollection::dispose()()
/svx/source/unodraw/unoshcol.cxx: 112 in SvxShapeCollection::dispose()()
________________________________________________________________________________________________________
*** CID 1620539: (LOCK_EVASION)
/svx/source/unodraw/unoshcol.cxx: 111 in SvxShapeCollection::dispose()()
105 bInDispose = false;
106 throw;
107 }
108
109 // the values bDispose and bInDisposing must set in this order.
110 // No multithread call overcome the "!rBHelper.bDisposed && !rBHelper.bInDispose" guard.
>>> CID 1620539: (LOCK_EVASION)
>>> Thread1 sets "bDisposed" to a new value. Now the two threads have an inconsistent view of "bDisposed" and updates to fields correlated with "bDisposed" may be lost.
111 bDisposed = true;
112 bInDispose = false;
113 }
114
115 // XComponent
116 void SAL_CALL SvxShapeCollection::addEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener )
/svx/source/unodraw/unoshcol.cxx: 112 in SvxShapeCollection::dispose()()
106 throw;
107 }
108
109 // the values bDispose and bInDisposing must set in this order.
110 // No multithread call overcome the "!rBHelper.bDisposed && !rBHelper.bInDispose" guard.
111 bDisposed = true;
>>> CID 1620539: (LOCK_EVASION)
>>> Thread1 sets "bInDispose" to a new value. Now the two threads have an inconsistent view of "bInDispose" and updates to fields correlated with "bInDispose" may be lost.
112 bInDispose = false;
113 }
114
115 // XComponent
116 void SAL_CALL SvxShapeCollection::addEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener )
117 {
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu6VvXBlQRUbS683tC8265rGNPXqJ1ffcoLZCnTuJFQbNcTEkb4XaEQkzovKhJ5DB3c-3Dnms-_A9M4dSy7guk8NP6DcfgslOyvJRzavztVIKj6nRqYjYpWom7SJFyX0y710bz0kUGtuN6DDqzf5Al9pUAVOcw8vTTCfFgArnY-2F0kj-2FLCdoPj5C54ejtT-2BI4BZ9yjrAMmBiqe46E2-2BiZWILpLchY-2FFg-2FognOhlBg6eKt8DSr3wHTnpw5AZSO6CCpKz9CNeZS4oY8H9QC-2B0BGaOnLIgYxoPj-2F6IFJM3Ks1ge2V11vtM9r3M-3D
More information about the LibreOffice
mailing list