Tcl Source Code

View Ticket
Login
Ticket UUID: 767e070d35e89c53c88f7f4d01c30249ea82466
Title: Tcl_GetRange and Tcl_GetUniChar do not validate index inputs
Type: Bug Created on: 2020-03-13 16:44:42
Submitter: dgp Assigned to: jan.nijtmans
Subsystem: 10. Objects Severity: Minor
Priority: 5 Medium Last modified: 2020-03-28 17:25:18
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2020-03-28 17:25:18
Version: all
Description:
Documentation says nothing about it, but the comments in the code note:

"The index is assumed to be in the appropriate range."

"The first and last indices are assumed to be in the appropriate range."

This is a burden on the caller that should at least be documented.

Arguably worse, since the check is not done, the operations of the routines
are then free to access unrestrained memory, which seems a risk at least.
User Comments:
jan.nijtmans added on 2020-03-28 17:24:57:
Fixed in 8.6 (backported from 8.7)