Tcl Source Code

View Ticket
Login
Ticket UUID: 52dbc4b3f8ef52c40eb8dd2080c5de48a14cd49c
Title: tclInterp.c: Tcl_Free() called through pointer of incorrect type
Type: Bug Version: 8.6.13
Submitter: chrstphrchvz Created on: 2023-10-13 08:35:33
Subsystem: 20. [interp] Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2023-10-17 09:53:47
Resolution: Fixed Closed By: chrstphrchvz
    Closed on: 2023-10-17 09:53:47
Description:

Tcl_Free() is not a Tcl_LimitHandlerDeleteProc. Nothing in core Tcl calls Tcl_LimitAddHandler() with TCL_DYNAMIC as the deleteProc, but I predict that doing so would cause UBSan -fsanitize=function errors with the following:

runtime error: call to function TclpFree through pointer to incorrect function type 'void (*)(void *)'

A workaround would be to use a wrapper function; see attached patch.

User Comments: chrstphrchvz added on 2023-10-17 09:53:47:

This was fixed in [e75f319dc8cf]. Thanks, Jan!


Attachments: