diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2006-01-31 21:50:35 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2006-01-31 21:50:35 (GMT) |
commit | da398dd788268e57c19358540d45815a56f39091 (patch) | |
tree | 14ebdde4841108afa2357d9269887d3222d684bc | |
parent | 40c05f388c258f0df118466d795d5ac6b52fa0b6 (diff) | |
download | powwow-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |