Skip to content

Commit

Permalink
CAVEPACKER: AddressSanitizer heap-buffer-overflow in BoardState #34
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerhardy committed Jan 3, 2016
1 parent 56ba5fc commit 9d8dbc7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cavepacker/shared/BoardState.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class BoardState {
* @return @c false if the conversion failed because the index isn't part of the board
*/
inline bool getColRowFromIndex(int index, int& col, int& row) const {
if (index < 0 || index >= _state.size())
return false;
if (_state[index] == '\0')
return false;
col = index % _width;
Expand Down

0 comments on commit 9d8dbc7

Please sign in to comment.