Summary: | Kopete hangs when AIM plugin receives text "=P" | ||
---|---|---|---|
Product: | [Unmaintained] kopete | Reporter: | Drew Fisher <drew.m.fisher> |
Component: | general | Assignee: | Kopete Developers <kopete-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | des |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Drew Fisher
2008-07-13 00:39:34 UTC
I can confirm this on recent SVN (<24hrs). My backtrace looks almost identical. I suspect addQuotesAroundAttributes() is at fault here. #0 0x00007ffe0d350b88 in QString::fromAscii_helper () from /srv/kde4/lib/kde4/kopete_aim.so #1 0x00007ffe0d354446 in QString (this=0x7fff28465bb0, ch=0x7ffe0d3817a7 "<") at /media/Library/KDE4/qt-copy/src/corelib/tools/qstring.h:391 #2 0x00007ffe0d363d8e in AIMAccount::addQuotesAroundAttributes (this=0x287fe80, message= {static null = {<No data fields>}, static shared_null = {ref = {_q_value = 14966}, alloc = 0, size = 0, data = 0x682b1a, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, static shared_empty = {ref = {_q_value = 375}, alloc = 0, size = 0, data = 0x7ffe2024b63a, clean = 0, simpletext = 0, righttoleft = 0, asciiCache = 0, capacity = 0, reserved = 0, array = {0}}, d = 0x7fff28465cc0, static codecForCStrings = 0x0}) at /home/des/Code/kde/kdenetwork/kopete/protocols/oscar/aim/aimaccount.cpp:769 #3 0x00007ffe0d365046 in AIMAccount::sanitizedMessage (this=0x287fe80, message=@0x7fff28465f10) at /home/des/Code/kde/kdenetwork/kopete/protocols/oscar/aim/aimaccount.cpp:282 #4 0x00007ffe0d1044b6 in OscarAccount::messageReceived (this=0x287fe80, message=@0x7fff28466c60) at /home/des/Code/kde/kdenetwork/kopete/protocols/oscar/oscaraccount.cpp:513 #5 0x00007ffe0d3644d6 in AIMAccount::messageReceived (this=0x287fe80, message=@0x7fff28466c60) at /home/des/Code/kde/kdenetwork/kopete/protocols/oscar/aim/aimaccount.cpp:517 #6 0x00007ffe0d1067f7 in OscarAccount::qt_metacall (this=0x287fe80, _c=QMetaObject::InvokeMetaMethod, _id=8, _a=0x7fff28466550) at /media/Library/KDE4/build/kdenetwork/kopete/protocols/oscar/oscaraccount.moc:124 ... The message that was passed into addQuotesAroundAttributes() was: "<BR>does it work? =P" startReplace is 19 (the 'P') going into the loop, and replaceLength is 1. sIndex and eIndex will be 0 and 3, respectively (start and end of the <BR> tag). The inner loop appears to be searching until it finds a tag that ends past the end of the =. But there is no such tag, so sIndex and eIndex both become -1 (indicating no match found), and thus eIndex never grows to be >= startReplace + replaceLength, causing the infinite loop. This function seems rather broken, as it assumes that '='s only occur in tags (look at attrRegExp). A better solution would be to do something like the following (this is pseudo-Perl syntax, as I'm not sure how Qt might do it): s/(\<[^>]*\s+)([\d\w]+)=([^"/>\s]+)([^<]*\>)/$1$2="$3"$4/ And then repeatedly apply the above to the whole message until it doesn't match anymore. SVN commit 831757 by rjarosz: Fix bug 166404: Kopete hangs when AIM plugin receives text "=P" BUG: 166404 M +7 -1 aimaccount.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=831757 SVN commit 831758 by rjarosz: Backport fix for bug 166404: Kopete hangs when AIM plugin receives text "=P" CCBUG: 166404 M +7 -1 aimaccount.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=831758 SVN commit 831800 by rjarosz: Backport fix for bug 166404: Kopete hangs when AIM plugin receives text "=P" CCBUG: 166404 M +7 -1 aimaccount.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=831800 |