Overview
| Artifact ID: | aea681282d8b6d13c4a0100675ca954ad8553fdf0c763a4c2e4ad5c5d3dd4b99 |
|---|---|
| Ticket: | 6cb3db4965ada9d88799c6a652534499bfc9b4a7
pointer arithmetic using NULL in InitArgsAndLocals() |
| User & Date: | chrstphrchvz on 2021-12-28 23:51:25 |
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 event-11.8: <pre> <span style="font-weight:bold">tcl/generic/tclProc.c:1431:30: <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/tclProc.c generic/tclProc.c index 642294cd8..1bd7361b1 100644 --- generic/tclProc.c +++ generic/tclProc.c @@ -1428,7 +1428,7 @@ InitArgsAndLocals( numArgs = procPtr->numArgs; argCt = framePtr->objc - skip; /* Set it to the number of args to the * procedure. */ <span style="color:red">- argObjs = framePtr->objv + skip;</span> <span style="color:green">+ argObjs = framePtr->objv ? framePtr->objv + skip : NULL;</span> if (numArgs == 0) { if (argCt) { goto incorrectArgs; </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: "22. [proc] and [uplevel]"
- title changed to:
pointer arithmetic using NULL in InitArgsAndLocals()
- type changed to: "Patch"