<table><tr><td style="">marten created this revision.<br />marten added a reviewer: Baloo.<br />Herald added projects: Frameworks, Baloo.<br />Herald added a subscriber: kde-frameworks-devel.<br />marten requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D19371">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Bug <a href="https://bugs.kde.org/show_bug.cgi?id=400594" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/show_bug.cgi?id=400594</a> was fixed by <a href="https://commits.kde.org/baloo/f4dd3f7bab790734b47a31c70fbb68297d4d3062" class="remarkup-link" target="_blank" rel="noreferrer">https://commits.kde.org/baloo/f4dd3f7bab790734b47a31c70fbb68297d4d3062</a><br />
which checks for the URL starting with "tags://" and considering this to be an invalid URL.  This is fine, but the problem is that if the URL "tags:/" is<br />
passed in the string is not long enough and QString::at() asserts.  This is seen as a crash of the ioslave every time the right click menu is popped up<br />
in Konqueror (on any sort of view), or from the command line by doing "kioclient5 ls tags:/":</p>

<p>kio_tags(11869) unknown: ASSERT: "uint(i) < uint(size())" in file /usr/include/qt5/QtCore/qstring.h, line 934</p>

<p>#10 0x00007f3d402fe0bc in qt_assert(char const*, char const*, int) () from /usr/lib64/libQt5Core.so.5<br />
#11 0x00007f3d36eec337 in QString::at (i=6, this=0x7ffd4531d8a8) at /usr/include/qt5/QtCore/qstring.h:934<br />
#12 Baloo::TagsProtocol::parseUrl (this=this@entry=0x7ffd4531da60, url=..., flags=...) at baloo/baloo/src/kioslaves/tags/kio_tags.cpp:299<br />
#13 0x00007f3d36eedda6 in Baloo::TagsProtocol::listDir (this=0x7ffd4531da60, url=...) at baloo/baloo/src/kioslaves/tags/kio_tags.cpp:59<br />
#14 0x00007f3d3663e1de in KIO::SlaveBase::dispatch (this=0x7ffd4531da70, command=71, data=...) at kio/src/core/slavebase.cpp:1176<br />
#15 0x00007f3d3663f78e in KIO::SlaveBase::dispatchLoop (this=0x7ffd4531da70) at kio/src/core/slavebase.cpp:325<br />
#16 0x00007f3d36ef1943 in kdemain (argc=<optimized out>, argv=<optimized out>) at baloo/baloo/src/kioslaves/tags/kio_tags.cpp:486</p>

<p>The QString::at() needs to be guarded by a length check.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Built Baloo with this change, verified that no crash happens when using the URL "tags:/"</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D19371">https://phabricator.kde.org/D19371</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/kioslaves/tags/kio_tags.cpp</div></div></div><br /><div><strong>To: </strong>marten, Baloo<br /><strong>Cc: </strong>kde-frameworks-devel, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams<br /></div>