fix: bounds check on column
This commit is contained in:
@@ -191,6 +191,11 @@ async fn handle_connection(
|
|||||||
|
|
||||||
// Check if valid move
|
// Check if valid move
|
||||||
if let Ok(column) = column_parse {
|
if let Ok(column) = column_parse {
|
||||||
|
if column >= 6 {
|
||||||
|
let _ = send(&tx, "ERROR:INVALID:MOVE");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if current_match.board[column][4] != Color::None {
|
if current_match.board[column][4] != Color::None {
|
||||||
let _ = send(&tx, "ERROR:INVALID:MOVE");
|
let _ = send(&tx, "ERROR:INVALID:MOVE");
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user