diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-11 12:31:48 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-11 12:31:48 (GMT) |
| commit | 7f62b768876fc8b0779d10ae3fcba1fc7aeaba04 (patch) | |
| tree | cc67956829bcf5ad5af0e714d5184b80475d25ce /generic/tclProc.c | |
| parent | 0715d88019e40aa514b3b2d3ba691ab7d0a96eb2 (diff) | |
| download | tcl-7f62b768876fc8b0779d10ae3fcba1fc7aeaba04.zip tcl-7f62b768876fc8b0779d10ae3fcba1fc7aeaba04.tar.gz tcl-7f62b768876fc8b0779d10ae3fcba1fc7aeaba04.tar.bz2 | |
Fix [https://core.tcl-lang.org/tk/tktview?name=3bc0f44ef3|3bc0f44ef3]: UBSan complains about body.chars[] usage.
(Yes, I know, this one is for Tk, but Tcl was using the same construct too ....)
Diffstat (limited to 'generic/tclProc.c')
| -rw-r--r-- | generic/tclProc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c index 4600382..a9134f2 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -600,7 +600,7 @@ TclCreateProc( */ localPtr = (CompiledLocal *)ckalloc( - TclOffset(CompiledLocal, name) + fieldValues[0]->length +1); + TclOffset(CompiledLocal, name) + fieldValues[0]->length + 1); if (procPtr->firstLocalPtr == NULL) { procPtr->firstLocalPtr = procPtr->lastLocalPtr = localPtr; } else { @@ -1305,8 +1305,8 @@ InitLocalCache( * for future calls. */ - localCachePtr = ckalloc(sizeof(LocalCache) - + (localCt - 1) * sizeof(Tcl_Obj *) + localCachePtr = (LocalCache *)ckalloc(TclOffset(LocalCache, varName0) + + localCt * sizeof(Tcl_Obj *) + numArgs * sizeof(Var)); namePtr = &localCachePtr->varName0; @@ -2499,12 +2499,12 @@ SetLambdaFromAny( * location (line of 2nd list element). */ - cfPtr = ckalloc(sizeof(CmdFrame)); + cfPtr = (CmdFrame *)ckalloc(sizeof(CmdFrame)); TclListLines(objPtr, contextPtr->line[1], 2, buf, NULL); cfPtr->level = -1; cfPtr->type = contextPtr->type; - cfPtr->line = ckalloc(sizeof(int)); + cfPtr->line = (int *)ckalloc(sizeof(int)); cfPtr->line[0] = buf[1]; cfPtr->nline = 1; cfPtr->framePtr = NULL; |
