Overview
| Artifact ID: | 3d902ef7d487c10a755700b1b51eb234e13eee5d |
|---|---|
| Ticket: | 1693986fffffffffffffffffffffffffffffffff
Buggy string handling in command traces? |
| User & Date: | msofer on 2007-04-04 01:26:18 |
Changes
- assignee changed to: "dgp"
- cmimetype changed to: "text/plain"
- comment changed to:
Looking at TEOv and TEOvI, trying to follow the trace code, I think I found a few possible bugs related to the 'command' string (no demos yet). (1) TEOv only generates a 'command' string from objv when there are interp-wide traces, but fails to do so on traces on the specific command. This is needed later on, especially since traces use the string interface. Note that this hints at moving the string generation to TEOvI, after Tcl_GetCommandFromObj has happened. (2) TclCheckInterpTraces and TclCheckExecutionTraces accept a counted (not nul-terminated) string for the 'command', but pass on just the char* and not the count. The receiver has no way to avoid a buffer overflow in case the string was not nul-terminated. Both TEBC and Tcl_Eval call TEOvI with counted strings (from the bc source resp from a parse token), so that the problem is not just theoretic. I see one possible solution: (a) generate nul-terminated strings for the traces, with better detection of when it is needed. This should happen in TCIT/TCET. I am not so worried of the duplication of effort in case both interp-wide and command-specific traces are in place (b) modify the api so that the user generates a string itself from objc/objv if none is supplied. This could well happen in TCIT and TCET, instead of burdening the callers to do so. Candidate patch forthcoming.
- foundin changed to: "obsolete: 8.5a6"
- is_private changed to: "0"
- priority changed to: "8"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "msofer"
- subsystem changed to: "46. Traces"
- title changed to: "Buggy string handling in command traces?"
- type changed to: "Bug"