[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    [Bug 129263] Crash related to auto indentation
From:       Johannes Sixt <johannes.sixt () telecom ! at>
Date:       2006-06-21 19:47:59
Message-ID: 20060621194759.12941.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=129263         




------- Additional Comments From johannes.sixt telecom at  2006-06-21 21:47 -------
Dominik,

If nextNonSpaceChar() does not find any non-space chars, it returns -1, which turns \
into 2^32-1 when it is passed to stringAtPos(), which takes an unit. Now, in this \
line in KateTextLine::stringAtPos():

    if (unicode[i+pos] != matchUnicode[i])

when i is still 0, i+pos becomes 2^32-1 due to then unsigned-ness of pos.
On a 64bit environment, an address that is 4GB away is addressed, which likely is not \
mapped. SIGSEGV. On 32bit hardware, this wraps around and addresses the QChar at \
unicode-1. This is still a bug, but it normally does not crash, because that address \
is available (malloc's administrative data). \
_______________________________________________ KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic