diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2002-03-15 15:39:06 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2002-03-15 15:39:06 (GMT) |
| commit | 5d6f66080a397caa85cfd3355f81267c9c8d7d89 (patch) | |
| tree | 9f578d4be03050603948e19b5188a382731b945f /generic/tclCompile.c | |
| parent | 3f80f55af60f673f0519c60ac2bc8acc2c32249f (diff) | |
| download | tcl-5d6f66080a397caa85cfd3355f81267c9c8d7d89.zip tcl-5d6f66080a397caa85cfd3355f81267c9c8d7d89.tar.gz tcl-5d6f66080a397caa85cfd3355f81267c9c8d7d89.tar.bz2 | |
Fixed buffer overrun reported in 530320; luckily it is not likely to
be exploitable in any meaningful way, but crashing Tcl instead of
triggering an error still isn't good.
Diffstat (limited to 'generic/tclCompile.c')
| -rw-r--r-- | generic/tclCompile.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 24a8693..d461309 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.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: tclCompile.c,v 1.31 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.32 2002/03/15 15:39:06 dkf Exp $ */ #include "tclInt.h" @@ -1239,10 +1239,11 @@ TclCompileTokens(interp, tokenPtr, count, envPtr) code = TclCompileTokens(interp, tokenPtr+2, tokenPtr->numComponents-1, envPtr); if (code != TCL_OK) { - sprintf(buffer, + char errorBuffer[150]; + sprintf(errorBuffer, "\n (parsing index for array \"%.*s\")", ((nameBytes > 100)? 100 : nameBytes), name); - Tcl_AddObjErrorInfo(interp, buffer, -1); + Tcl_AddObjErrorInfo(interp, errorBuffer, -1); goto error; } if (localVar < 0) { |
