Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions roaringarray.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,17 @@ func (ra *roaringArray) readFrom(stream internal.ByteInput, cookieHeader ...byte
if err != nil {
return stream.GetReadBytes(), fmt.Errorf("malformed bitmap, failed to read is-run bitmap, got: %s", err)
}
isAllZero := true
for i := 0; i < isRunBitmapSize; i++ {
if isRunBitmap[i] != 0 {
isAllZero = false
break
}
}
if isAllZero {
return stream.GetReadBytes(), fmt.Errorf("malformed bitmap, is-run bitmap cannot be all zero")
}

} else if cookie == serialCookieNoRunContainer {
size, err = stream.ReadUInt32()
if err != nil {
Expand Down
Loading