diff options
author | dgp <dgp@users.sourceforge.net> | 2013-06-26 20:13:57 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-06-26 20:13:57 (GMT) |
commit | d8e108cc4748d02d928366cc07447b2e738e796b (patch) | |
tree | 15cf45d4cf45d83d1ce0d4aba51644f981f528a8 | |
parent | d586d955ce5e6ebbd9b670d848ef7c4f4935f9f3 (diff) | |
download | tcl-d8e108cc4748d02d928366cc07447b2e738e796b.zip tcl-d8e108cc4748d02d928366cc07447b2e738e796b.tar.gz tcl-d8e108cc4748d02d928366cc07447b2e738e796b.tar.bz2 |
Stop buffer overrun into undefined values detected by valgrind.
-rw-r--r-- | generic/tclOptimize.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclOptimize.c b/generic/tclOptimize.c index cd37a6a..b7f4173 100644 --- a/generic/tclOptimize.c +++ b/generic/tclOptimize.c @@ -212,7 +212,8 @@ ConvertZeroEffectToNOP( int blank = 0, i, nextInst; size = AddrLength(currentInstPtr); - while (*(currentInstPtr+size) == INST_NOP) { + while ((currentInstPtr + size < envPtr->codeNext) + && *(currentInstPtr+size) == INST_NOP) { if (IsTargetAddress(&targets, currentInstPtr + size)) { break; } |