diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-09-01 07:24:27 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-09-01 07:24:27 (GMT) |
| commit | de0141902204b22272fa9f6594e9b6d7e6668d1b (patch) | |
| tree | 3cda05cfd3dec3cc55b285d951859ba9e0543772 /generic/tclBasic.c | |
| parent | 69ab106ada454c937fe9a904a77b9b68a139712d (diff) | |
| download | tcl-de0141902204b22272fa9f6594e9b6d7e6668d1b.zip tcl-de0141902204b22272fa9f6594e9b6d7e6668d1b.tar.gz tcl-de0141902204b22272fa9f6594e9b6d7e6668d1b.tar.bz2 | |
Fix [85fc8bca03]: Pointer arithmetic with NULL in buildInfoObjCmd(). Update changes.md
Diffstat (limited to 'generic/tclBasic.c')
| -rw-r--r-- | generic/tclBasic.c | 6 |
1 files changed, 4 insertions, 2 deletions
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] == '-') { |
