Fix unsigned overflow in Debug::Block dtor

Signed-off-by: mio <stigma@disroot.org>
pull/67/head
mio 2 months ago
parent 1d285726d1
commit 956d90f8cb

@ -194,7 +194,10 @@ namespace Debug LIBAMAROK_EXPORT
double duration = double(end.tv_sec) + (double(end.tv_usec) / 1000000.0); double duration = double(end.tv_sec) + (double(end.tv_usec) / 1000000.0);
Debug::modifieableIndent().truncate( Debug::indent().length() - 2 ); // Prevent overflow that causes UINT_MAX allocation.
uint newLength = (Debug::indent().length() < 2) ? 0 : (Debug::indent().length() - 2);
Debug::modifieableIndent().truncate( newLength );
kdDebug() << "END__: " << m_label kdDebug() << "END__: " << m_label
<< " - Took " << TQString::number( duration, 'g', 2 ) << "s\n"; << " - Took " << TQString::number( duration, 'g', 2 ) << "s\n";
mutex.unlock(); mutex.unlock();

Loading…
Cancel
Save