Skip to content

Commit

Permalink
Don't check for length parameter as it can be zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
shaeberling committed Sep 30, 2022
1 parent 49de384 commit 21aa22b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ private boolean isStateValid(SystemState state) {
private static boolean isRegionValid(SystemState.MemoryRegion region) {
final int MAX_SIZE = 1000000;
boolean valid = region.getStart() >= 0 && region.getStart() < MAX_SIZE
&& region.getLength() > 0 && region.getLength() < MAX_SIZE
&& region.getData().toByteArray().length < MAX_SIZE
&& region.getData().toByteArray().length == region.getLength();
&& region.getLength() < MAX_SIZE
&& region.getData().toByteArray().length < MAX_SIZE;
if (!valid) {
log.warning("===== Region is invalid: =====");
log.warning("Start : " + region.getStart());
Expand Down

0 comments on commit 21aa22b

Please sign in to comment.