aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2006-01-31 21:50:35 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2006-01-31 21:50:35 (GMT)
commitda398dd788268e57c19358540d45815a56f39091 (patch)
tree14ebdde4841108afa2357d9269887d3222d684bc
parent40c05f388c258f0df118466d795d5ac6b52fa0b6 (diff)
downloadpowwow-da398dd788268e57c19358540d45815a56f39091.zip
powwow-da398dd788268e57c19358540d45815a56f39091.tar.gz
powwow-da398dd788268e57c19358540d45815a56f39091.tar.bz2
Fixes operator . (dot) which didn't check for valid index range. (Elestir)
-rw-r--r--eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 7910442..e349666 100644
--- a/eval.c
+++ b/eval.c
@@ -881,7 +881,8 @@ static int exe_op __P1 (operator *,op)
ptrlen(start) - (ssrc+srclen+1 - ptrdata(start)));
break;
case (int)point:
- dst = ptrmcpy(dst, ssrc+o2.num-1, 1);
+ j = o2.num <= srclen ? o2.num-1 : srclen;
+ dst = ptrmcpy(dst, ssrc+j, 1);
break;
case (int)point_less:
j = o2.num < srclen ? o2.num : srclen;