Skip to content

Commit

Permalink
Fix out of bounds array access
Browse files Browse the repository at this point in the history
Refactoring in #41693 accidentally introduced an out-of-bounds array
access in overmapbuffer::scents_near.  Fix it.
  • Loading branch information
jbytheway committed Nov 8, 2020
1 parent 3ca72ac commit 3783a24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/overmapbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ std::array<std::array<scent_trace, 3>, 3> overmapbuffer::scents_near( const trip
for( int x = -1; x <= 1 ; ++x ) {
for( int y = -1; y <= 1; ++y ) {
tripoint_abs_omt iter = origin + point( x, y );
found_traces[x][y] = scent_at( iter );
found_traces[x + 1][y + 1] = scent_at( iter );
}
}

Expand Down

0 comments on commit 3783a24

Please sign in to comment.