[kde-doc-english] [docs] [Bug 261509] meinproc4: crash with segfault on Mac OS X

RJVB rjvbertin at gmail.com
Wed Sep 3 00:18:37 UTC 2014


https://bugs.kde.org/show_bug.cgi?id=261509

RJVB <rjvbertin at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rjvbertin at gmail.com

--- Comment #10 from RJVB <rjvbertin at gmail.com> ---
(In reply to kde from comment #5)
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0   com.apple.CoreFoundation            0x00007fff8a32ae4f CFStringGetLength
> + 15
> 1   libkdecore.5.dylib                  0x0000000100e49011
> convert_CFString_to_QString(__CFString const*) + 49


Whether or not the bug is indeed in convert_CFString_to_QString(), it might be
a good idea to protect that function against null CFStringRefs:

    QString convert_CFString_to_QString(CFStringRef str) {
            if( str ){
            CFIndex length = CFStringGetLength(str);
            const UniChar *chars = CFStringGetCharactersPtr(str);
            if (chars)
                return QString(reinterpret_cast<const QChar *>(chars), length);

            QVarLengthArray<UniChar> buffer(length);
            CFStringGetCharacters(str, CFRangeMake(0, length), buffer.data());
            return QString(reinterpret_cast<const QChar *>(buffer.constData()),
length);
        }
        else{
            return QString();
        }
    }

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the kde-doc-english mailing list