author | erik <erik> | 2007-01-24 23:29:42 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-24 23:29:42 (UTC) |
commit | 0076a11b467dce1233194ce228287a2a127b1f5d (patch) (side-by-side diff) | |
tree | f2136a1a3e9b5fd6bede52251ed7249365838752 /noncore/games/backgammon | |
parent | 48d9219a96096cf44df8ac24413b36d1b718b1d5 (diff) | |
download | opie-0076a11b467dce1233194ce228287a2a127b1f5d.zip opie-0076a11b467dce1233194ce228287a2a127b1f5d.tar.gz opie-0076a11b467dce1233194ce228287a2a127b1f5d.tar.bz2 |
Each file in this commit has the issue where it is possible for code to
overrun static buffers. This could lead to serious problems. Granted it
is almost impossible to do that. But it isn't totally impossible. So this
commit makes it impossible to overrun.
-rw-r--r-- | noncore/games/backgammon/moveengine.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/games/backgammon/moveengine.cpp b/noncore/games/backgammon/moveengine.cpp index a4145cc..b102258 100644 --- a/noncore/games/backgammon/moveengine.cpp +++ b/noncore/games/backgammon/moveengine.cpp @@ -53,7 +53,8 @@ void MoveEngine::position(Pieces& pieces,bool non_qte) { if(population[a].total>0) //player 1 pieces { - pieces.player1[player1_counter].x=x_coord[a]-offset; + if (a < 26) + pieces.player1[player1_counter].x=x_coord[a]-offset; if(a>=0 && a<13) { pieces.player1[player1_counter].y=yup_coord[b]-offset; @@ -96,7 +97,8 @@ void MoveEngine::position(Pieces& pieces,bool non_qte) else if(population[a].total<0) //player 2 pieces { - pieces.player2[player2_counter].x=x_coord[a]-offset; + if (a < 26) + pieces.player2[player2_counter].x=x_coord[a]-offset; if(a>=0 && a<13) { pieces.player2[player2_counter].y=yup_coord[b]-offset; |