Skip to content

Commit c1022cc

Browse files
committed
validation
1 parent 057a06f commit c1022cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

iabgpp-encoder/src/main/java/com/iab/gpp/encoder/datatype/encoder/IntegerBitSet.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,15 @@ public Spliterator.OfInt spliterator(){
101101
public IntStream intStream() {
102102
return StreamSupport.intStream(spliterator(), false);
103103
}
104-
104+
105105
private static final void logOutOfRange(int value) {
106106
LOGGER.warning("Exceeding IntegerBitSet.MAX_COLLECTION_SIZE: "+ value);
107107
}
108108

109109
public void addRange(int start, int end) {
110+
if (end < start) {
111+
throw new IllegalArgumentException("Negative length range");
112+
}
110113
int realStart = from + start;
111114
int realEnd = from + end;
112115
if (realStart >= to) {

0 commit comments

Comments
 (0)