aboutsummaryrefslogtreecommitdiff
path: root/jim.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-09-16 09:43:17 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:52 +1000
commitdbbd3ddbdbf2849591a911e6f3c0919d1e42072a (patch)
tree4315536cd2f28a8d590bf5b49a729af90283bcf4 /jim.c
parentf599695f837c19be5d903e5c42097b3514ea3573 (diff)
downloadjimtcl-dbbd3ddbdbf2849591a911e6f3c0919d1e42072a.zip
jimtcl-dbbd3ddbdbf2849591a911e6f3c0919d1e42072a.tar.gz
jimtcl-dbbd3ddbdbf2849591a911e6f3c0919d1e42072a.tar.bz2
It was possible to create a bad ref
Need to fix invalid chars in the tag name Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim.c')
-rw-r--r--jim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/jim.c b/jim.c
index 5949bf8..17f41f0 100644
--- a/jim.c
+++ b/jim.c
@@ -4368,13 +4368,13 @@ Jim_Obj *Jim_NewReference(Jim_Interp *interp, Jim_Obj *objPtr, Jim_Obj *tagPtr,
refObjPtr->internalRep.refValue.id = interp->referenceNextId;
refObjPtr->internalRep.refValue.refPtr = refPtr;
interp->referenceNextId++;
- /* Set the tag. Trimmered at JIM_REFERENCE_TAGLEN. Everything
+ /* Set the tag. Trimmed at JIM_REFERENCE_TAGLEN. Everything
* that does not pass the 'isrefchar' test is replaced with '_' */
tag = Jim_GetString(tagPtr, &tagLen);
if (tagLen > JIM_REFERENCE_TAGLEN)
tagLen = JIM_REFERENCE_TAGLEN;
for (i = 0; i < JIM_REFERENCE_TAGLEN; i++) {
- if (i < tagLen)
+ if (i < tagLen && isrefchar(tag[i]))
refPtr->tag[i] = tag[i];
else
refPtr->tag[i] = '_';