Overview
| Artifact ID: | 724048be43bb4a1eaa5e6709680f323d288d798c1756fcd71e3c13c85bc5fb4f |
|---|---|
| Ticket: | fba9c1fc1236944900ffcb4ac09ef7de44a98a6e
pointer arithmetic using NULL in PrintParse() |
| User & Date: | chrstphrchvz on 2021-12-29 00:27:19 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
[https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#available-checks|UBSan <tt>-fsanitize=pointer-overflow</tt>] error during test parseExpr-1.1: <pre> <span style="font-weight:bold">tcl/generic/tclTest.c:3623:46: <span style="color:red">runtime error:</span> applying zero offset to null pointer</span> </pre> Using a ternary expression avoids the error: <pre> diff --git generic/tclTest.c generic/tclTest.c index 5774dfc16..203c2ca4b 100644 --- generic/tclTest.c +++ generic/tclTest.c @@ -3596,7 +3596,9 @@ PrintParse( Tcl_NewIntObj(tokenPtr->numComponents)); } Tcl_ListObjAppendElement(NULL, objPtr, <span style="color:red">- Tcl_NewStringObj(parsePtr->commandStart + parsePtr->commandSize,</span> <span style="color:green">+ Tcl_NewStringObj(parsePtr->commandStart + ? parsePtr->commandStart + parsePtr->commandSize + : NULL,</span> -1)); } <span> </span> </pre> - foundin changed to: "8.6.12"
- is_private changed to: "0"
- login: "chrstphrchvz"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "chrstphrchvz"
- subsystem changed to: "34. tcltest Package"
- title changed to: "pointer arithmetic using NULL in PrintParse()"
- type changed to: "Patch"