| Summary: | Out-of-range input makes the program crash. | ||
|---|---|---|---|
| Product: | CS3343 Chinese Checker | Reporter: | yutongmen2-c |
| Component: | Algorithm Component | Assignee: | yutongmen2-c |
| Status: | CONFIRMED --- | ||
| Severity: | minor | CC: | yutongmen2-c |
| Priority: | --- | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
yutongmen2-c
2021-11-29 11:53:35 HKT
Previous code:
do {
if (in.hasNextInt()) {
start_x = in.nextInt();
start_y = in.nextInt();
}
} while (!start_m.isValidStartMove());
Modified code:
do {
if (in.hasNextInt()) {
start_x = in.nextInt();
start_y = in.nextInt();
}
} while (start_x < 0 || start_x > 8 || start_y < 0 || start_y > 8);
|