Fix crash when doing open recent
ClosedPublic

Authored by aacid on Wed, Aug 21, 7:24 PM.

Details

Summary
==6212== Invalid read of size 8
==6212==    at 0x6B0FFB0: QUrl::QUrl(QUrl const&) (in /usr/lib/libQt5Core.so.5.13.0)
==6212==    by 0x53461BB: KRecentFilesAction::addUrl(QUrl const&, QString const&) (krecentfilesaction.cpp:159)
==6212==    by 0x1B53C7: kpMainWindow::addRecentURL(QUrl const&) (kpMainWindow_File.cpp:221)
==6212==    by 0x1B5BC3: kpMainWindow::open(QUrl const&, bool) (kpMainWindow_File.cpp:426)
==6212==    by 0x1B629D: kpMainWindow::slotOpenRecent(QUrl const&) (kpMainWindow_File.cpp:507)
==6212==    by 0x1BBEAA: QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QUrl const&>, void, void (kpMainWindow::*)(QUrl const&)>::call(void (kpMainWindow::*)(QUrl const&), kpMainWindow*, void**) (qobjectdefs_impl.h:152)
==6212==    by 0x1BBA10: void QtPrivate::FunctionPointer<void (kpMainWindow::*)(QUrl const&)>::call<QtPrivate::List<QUrl const&>, void>(void (kpMainWindow::*)(QUrl const&), kpMainWindow*, void**) (qobjectdefs_impl.h:185)
==6212==    by 0x1BB717: QtPrivate::QSlotObject<void (kpMainWindow::*)(QUrl const&), QtPrivate::List<QUrl const&>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qobjectdefs_impl.h:414)
==6212==    by 0x6BEEB6F: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/libQt5Core.so.5.13.0)
==6212==    by 0x5347959: KRecentFilesAction::urlSelected(QUrl const&) (moc_krecentfilesaction.cpp:210)
==6212==    by 0x5345B08: KRecentFilesActionPrivate::_k_urlSelected(QAction*) (krecentfilesaction.cpp:98)
==6212==    by 0x53475B7: KRecentFilesAction::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_krecentfilesaction.cpp:96)
==6212==  Address 0x10be2b50 is 32 bytes inside a block of size 40 free'd
==6212==    at 0x48399AB: free (vg_replace_malloc.c:530)
==6212==    by 0x6A5D3D7: QMapDataBase::freeNodeAndRebalance(QMapNodeBase*) (in /usr/lib/libQt5Core.so.5.13.0)
==6212==    by 0x5348F66: QMapData<QAction*, QUrl>::deleteNode(QMapNode<QAction*, QUrl>*) (qmap.h:280)
==6212==    by 0x5348453: QMap<QAction*, QUrl>::remove(QAction* const&) (qmap.h:948)
==6212==    by 0x5346786: KRecentFilesAction::removeAction(QAction*) (krecentfilesaction.cpp:219)
==6212==    by 0x54F1DA9: KSelectAction::clear() (in /usr/lib/libKF5WidgetsAddons.so.5.61.0)
==6212==    by 0x534693B: KRecentFilesAction::clearEntries() (krecentfilesaction.cpp:249)
==6212==    by 0x5346AB8: KRecentFilesAction::loadEntries(KConfigGroup const&) (krecentfilesaction.cpp:261)
==6212==    by 0x1B538D: kpMainWindow::addRecentURL(QUrl const&) (kpMainWindow_File.cpp:216)
==6212==    by 0x1B5BC3: kpMainWindow::open(QUrl const&, bool) (kpMainWindow_File.cpp:426)
==6212==    by 0x1B629D: kpMainWindow::slotOpenRecent(QUrl const&) (kpMainWindow_File.cpp:507)
==6212==    by 0x1BBEAA: QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<QUrl const&>, void, void (kpMainWindow::*)(QUrl const&)>::call(void (kpMainWindow::*)(QUrl const&), kpMainWindow*, void**) (qobjectdefs_impl.h:152)
==6212==  Block was alloc'd at
==6212==    at 0x483877F: malloc (vg_replace_malloc.c:299)
==6212==    by 0x6A5D798: QMapDataBase::createNode(int, int, QMapNodeBase*, bool) (in /usr/lib/libQt5Core.so.5.13.0)
==6212==    by 0x5348E0D: QMapData<QAction*, QUrl>::createNode(QAction* const&, QUrl const&, QMapNode<QAction*, QUrl>*, bool) (qmap.h:225)
==6212==    by 0x5348362: QMap<QAction*, QUrl>::insert(QAction* const&, QUrl const&) (qmap.h:726)
==6212==    by 0x5346707: KRecentFilesAction::addAction(QAction*, QUrl const&, QString const&) (krecentfilesaction.cpp:210)
==6212==    by 0x5346F26: KRecentFilesAction::loadEntries(KConfigGroup const&) (krecentfilesaction.cpp:307)
==6212==    by 0x1B48BF: kpMainWindow::setupFileMenuActions() (kpMainWindow_File.cpp:99)
==6212==    by 0x1ACA61: kpMainWindow::setupActions() (kpMainWindow.cpp:505)
==6212==    by 0x1ABD19: kpMainWindow::init() (kpMainWindow.cpp:218)
==6212==    by 0x1AB253: kpMainWindow::kpMainWindow() (kpMainWindow.cpp:67)
==6212==    by 0x196C6F: main (kolourpaint.cpp:118)

Diff Detail

Repository
R374 KolourPaint
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
aacid requested review of this revision.Wed, Aug 21, 7:24 PM
aacid created this revision.

Crash was introduced in commit decc2d76df6b6ac1515127183dae4babb6c3ace2
Author: André Agenor
Date: Tue Feb 19 14:35:31 2019 -0300

Modernizes and remove Clang-Tyde warnings
aacid edited the summary of this revision. (Show Details)Wed, Aug 21, 7:25 PM
vkrause accepted this revision.Wed, Aug 21, 7:34 PM
This revision is now accepted and ready to land.Wed, Aug 21, 7:34 PM
stikonas accepted this revision.Wed, Aug 21, 7:41 PM
This revision was automatically updated to reflect the committed changes.