Skip to content
Snippets Groups Projects
Commit eb67be97 authored by Enrique Kajomovitz Must's avatar Enrique Kajomovitz Must
Browse files

bug fix with off by one pointer check

parent b9a6001c
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@ void Muon::nsw::NSWTriggerSTGL1AElink::decode_data(std::size_t& readPointer) {
while (readPointer < endOfData) {
static constexpr auto SIZE_DATA_HEADER = STGTPL1A::size_stream_head_nbits + STGTPL1A::size_stream_head_nwords +
STGTPL1A::size_stream_head_fifo_size + STGTPL1A::size_stream_head_streamID;
if (readPointer + SIZE_DATA_HEADER >= endOfData) {
if (readPointer + SIZE_DATA_HEADER > endOfData) {
throw std::length_error(
Muon::nsw::format("Read pointer ({}) would excede memory dedicated to data chunks ({}) while parsing the header (size: {})",
readPointer, endOfData, SIZE_DATA_HEADER));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment