Skip to content

Commit

Permalink
Fix a bug in the bounds check for Bytes.zeroOut()
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lawrey committed Jun 24, 2015
1 parent ab5945f commit 2f0c90c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/net/openhft/chronicle/bytes/BytesStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ default void copyTo(BytesStore store) {
}

default B zeroOut(long start, long end) {
if (start < start() || end > capacity() || end > start)
if (end <= start)
return (B) this;
if (start < start() || end > capacity())
throw new IllegalArgumentException();
long i = start;
for (; i < end - 7; i++)
Expand Down

0 comments on commit 2f0c90c

Please sign in to comment.