Artifacts Associated With Ticket 85fc8bca03
Ticket change [9429a65a90] (rid 244833) by chrstphrchvz on 2025-08-31 22:50:10:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Example UBSan error for the default case: <pre> % tcl::build-info boneless <b>tclBasic.c:755:36: <span style="color:firebrick">runtime error:</span> applying non-zero offset 1 to null pointer</b> 0 </pre> The error is due to <tt>p++</tt> being used as the for loop condition. I believe there is an instance of this in the <tt>ID_COMPILER</tt> case as well. One possible fix: <pre> --- generic/tclBasic.c +++ generic/tclBasic.c @@ -731,7 +731,8 @@ } return TCL_OK; case ID_COMPILER: <span style="color:firebrick">- for (p = strchr(buildData, '.'); p++; p = strchr(p, '.')) {</span> <span style="color:green">+ for (p = strchr(buildData, '.'); p != NULL; p = strchr(p, '.')) { + p++;</span> /* * Does the word begin with one of the standard prefixes? */ @@ -752,7 +753,8 @@ break; default: /* Boolean test for other identifiers' presence */ arg = TclGetStringFromObj(objv[1], &len); <span style="color:firebrick">- for (p = strchr(buildData, '.'); p++; p = strchr(p, '.')) {</span> <span style="color:green">+ for (p = strchr(buildData, '.'); p != NULL; p = strchr(p, '.')) { + p++;</span> if (!strncmp(p, arg, len) && ((p[len] == '.') || (p[len] == '-') || (p[len] == '\0'))) { if (p[len] == '-') { </pre> - foundin initialized to: "core-8-branch"
- is_private initialized to: "0"
- login: "chrstphrchvz"
- priority initialized to: "5 Medium"
- private_contact initialized to: "6133eb3026f9b10aa9b7b48da92ae2834fc225b0"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "chrstphrchvz"
- subsystem initialized to: "54. Configuration Reporting"
- title initialized to: "Pointer arithmetic with NULL in buildInfoObjCmd()"
- type initialized to: "Bug"
Ticket change [05edac02d5] (rid 244853) by jan.nijtmans on 2025-09-01 07:29:01:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2460919.81182229"
- closer changed to: "jan.nijtmans"
- foundin changed to: "9.0"
- icomment:
Fixed [6d62aed3e5980b48|here] Thanks for the report and the fix!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"