summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2014-01-31 09:13:13 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2014-01-31 09:13:13 (GMT)
commit81e405a16c6eff768e23d1c43c292e4875b86a16 (patch)
tree3d0294109081f1c1390217f433cbdfda0304662f /generic
parent9ac255b85b57fd192a8255ed8d8ca73bf5306748 (diff)
downloadtcl-81e405a16c6eff768e23d1c43c292e4875b86a16.zip
tcl-81e405a16c6eff768e23d1c43c292e4875b86a16.tar.gz
tcl-81e405a16c6eff768e23d1c43c292e4875b86a16.tar.bz2
Fix [4b3b7a3082]: tcl8.5.15/generic/tclExecute.c:7713: array index before sanity check ?
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index e657828..2e396e8 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -73,7 +73,7 @@ int tclTraceExec = 0;
* disjoint for backward-compatability reasons.
*/
-static const char *operatorStrings[] = {
+static const char *const operatorStrings[] = {
"||", "&&", "|", "^", "&", "==", "!=", "<", ">", "<=", ">=", "<<", ">>",
"+", "-", "*", "/", "%", "+", "-", "~", "!",
"BUILTIN FUNCTION", "FUNCTION",
@@ -86,7 +86,7 @@ static const char *operatorStrings[] = {
*/
#ifdef TCL_COMPILE_DEBUG
-static const char *resultStrings[] = {
+static const char *const resultStrings[] = {
"TCL_OK", "TCL_ERROR", "TCL_RETURN", "TCL_BREAK", "TCL_CONTINUE"
};
#endif
@@ -7710,10 +7710,12 @@ IllegalExprOperandType(
ClientData ptr;
int type;
unsigned char opcode = *pc;
- const char *description, *operator = operatorStrings[opcode - INST_LOR];
+ const char *description, *operator = "unknown";
if (opcode == INST_EXPON) {
operator = "**";
+ } else if (opcode <= INST_STR_NEQ) {
+ operator = operatorStrings[opcode - INST_LOR];
}
if (GetNumberFromObj(NULL, opndPtr, &ptr, &type) != TCL_OK) {