From de0141902204b22272fa9f6594e9b6d7e6668d1b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 1 Sep 2025 07:24:27 +0000 Subject: Fix [85fc8bca03]: Pointer arithmetic with NULL in buildInfoObjCmd(). Update changes.md --- changes.md | 2 ++ generic/tclBasic.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/changes.md b/changes.md index 763d878..1a0b1ea 100644 --- a/changes.md +++ b/changes.md @@ -12,6 +12,8 @@ to the userbase. # Bug fixes - [On Unix, IsTimeNative() always defined but not always used](https://core.tcl-lang.org/tcl/tktview/6b8e39) - [Tweak install permissions](https://core.tcl-lang.org/tcl/tktview/31d4fa) + - [interp creation resets encoding directory search path](https://core.tcl-lang.org/tcl/tktview/87b697) + - [Pointer arithmetic with NULL in buildInfoObjCmd()](https://core.tcl-lang.org/tcl/tktview/85fc8b) # Updated bundled packages, libraries, standards, data - platform 1.1.0 diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 94d464f..f8249ee 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -731,7 +731,8 @@ buildInfoObjCmd2( } return TCL_OK; case ID_COMPILER: - for (p = strchr(buildData, '.'); p++; p = strchr(p, '.')) { + for (p = strchr(buildData, '.'); p != NULL; p = strchr(p, '.')) { + p++; /* * Does the word begin with one of the standard prefixes? */ @@ -752,7 +753,8 @@ buildInfoObjCmd2( break; default: /* Boolean test for other identifiers' presence */ arg = TclGetStringFromObj(objv[1], &len); - for (p = strchr(buildData, '.'); p++; p = strchr(p, '.')) { + for (p = strchr(buildData, '.'); p != NULL; p = strchr(p, '.')) { + p++; if (!strncmp(p, arg, len) && ((p[len] == '.') || (p[len] == '-') || (p[len] == '\0'))) { if (p[len] == '-') { -- cgit v0.12