Tk Source Code

View Ticket
Login
Ticket UUID: 1615425
Title: [tag add] segfaults if index out of range of peer
Type: Bug Version: obsolete: 8.5.10
Submitter: treectrl Created on: 2006-12-14 01:48:36
Subsystem: 18. [text] Assigned To: fvogel
Priority: 7 High Severity: Minor
Status: Closed Last Modified: 2013-09-23 21:38:29
Resolution: Fixed Closed By: fvogel
    Closed on: 2013-09-23 21:38:29
Description:
pack [text .t] -side top
.t insert end "1\n2\n3\n4\n5\n"
.t tag configure tagA -font {Courier 10 bold}
pack [.t peer create .t2 -startline 3] -side top
.t tag add tagA 1.0 1.end
update


Adding a tag to a range of characters before -startline of a peer causes a segfault.
I think this is because [tag add] calls TkTextRedrawTag() with non-NULL indices.
User Comments: fvogelnew1 added on 2012-02-29 03:49:42:

allow_comments - 1

Merged in core-8-5-branch and trunk. Closing now.

fvogelnew1 added on 2012-02-04 04:06:26:
Test for the present bug 1615425 added in branch bug-1630262

fvogelnew1 added on 2012-02-02 17:44:21:
I will add specific tests for bug-1615425 soon.

fvogelnew1 added on 2012-02-02 17:43:10:
The fix I have just pushed in branch bug-1630262 (in order to fix this latter bug) also fixes this bug-1615425.

treectrl added on 2007-01-02 02:22:15:
Logged In: YES 
user_id=669413
Originator: YES

The problem seems to be that the startLine argument to TkTextInvalidateLineMetrics in TextRedrawTag is a negative number for the peer in the example above which leads to a segfault when AsyncUpdateLineMetrics gets called during the "update".