diff options
author | dkf <dkf@noemail.net> | 2010-10-01 12:52:47 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2010-10-01 12:52:47 (GMT) |
commit | 380a233e6334d13ff3cc8cd13353a16135b5788b (patch) | |
tree | 9bc2b696d5f1dd703e2c0f71eec0ffb13ca67447 /generic/tclResolve.c | |
parent | 80fd23b4f4aaf7411dfb09003e84ea12fae5bbab (diff) | |
download | tcl-380a233e6334d13ff3cc8cd13353a16135b5788b.zip tcl-380a233e6334d13ff3cc8cd13353a16135b5788b.tar.gz tcl-380a233e6334d13ff3cc8cd13353a16135b5788b.tar.bz2 |
* generic/tclBasic.c, generic/tclClock.c, generic/tclEncoding.c,
* generic/tclEnv.c, generic/tclLoad.c, generic/tclNamesp.c,
* generic/tclObj.c, generic/tclRegexp.c, generic/tclResolve.c,
* generic/tclResult.c, generic/tclUtil.c, macosx/tclMacOSXFCmd.c:
More purging of strcpy() from locations where we already know the
length of the data being copied.
FossilOrigin-Name: 50bdab468291447e44eee4503c3fcce02a5dea4d
Diffstat (limited to 'generic/tclResolve.c')
-rw-r--r-- | generic/tclResolve.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclResolve.c b/generic/tclResolve.c index 7a86427..109948e 100644 --- a/generic/tclResolve.c +++ b/generic/tclResolve.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclResolve.c,v 1.12 2010/01/29 16:17:20 nijtmans Exp $ + * RCS: @(#) $Id: tclResolve.c,v 1.13 2010/10/01 12:52:50 dkf Exp $ */ #include "tclInt.h" @@ -67,6 +67,7 @@ Tcl_AddInterpResolvers( { Interp *iPtr = (Interp *) interp; ResolverScheme *resPtr; + unsigned len; /* * Since we're adding a new name resolution scheme, we must force all code @@ -103,8 +104,9 @@ Tcl_AddInterpResolvers( */ resPtr = (ResolverScheme *) ckalloc(sizeof(ResolverScheme)); - resPtr->name = (char *) ckalloc((unsigned)(strlen(name) + 1)); - strcpy(resPtr->name, name); + len = strlen(name) + 1; + resPtr->name = (char *) ckalloc(len); + memcpy(resPtr->name, name, len); resPtr->cmdResProc = cmdProc; resPtr->varResProc = varProc; resPtr->compiledVarResProc = compiledVarProc; |