Skip to content

Commit a124ac1

Browse files
committed
umbj: Fix validation and error message for reading Boolean arrays.
So complain if e.g. is-state-initial.bin is not multiple of 8 bytes.
1 parent 3ab49cc commit a124ac1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

prism/src/io/github/pmctools/umbj/UMBReader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,9 @@ private void extractBooleanArraySparse(String filename, long size, LongConsumer
520520
UMBIn umbIn = open();
521521
try {
522522
long entrySize = umbIn.findArchiveEntry(filename);
523-
long minExpectedSize = (size + 7) / 8;
524-
long maxExpectedSize = ((size + 63) / 64) * 8;
525-
if (entrySize < minExpectedSize && entrySize > maxExpectedSize) {
523+
//long minExpectedSize = (size + 7) / 8;
524+
long expectedSize = ((size + 63) / 64) * 8;
525+
if (entrySize != expectedSize) {
526526
throw new UMBException("File " + filename + " has unexpected size (" + entrySize + " bytes)");
527527
}
528528
ByteBuffer bytes;

0 commit comments

Comments
 (0)