bugfix: avoid underflow in numerical condition
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Jun 2008 19:24:17 +0000 (19:24 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 12 Jun 2008 19:24:17 +0000 (19:24 +0000)
HLT/BASE/util/AliHLTRawReaderPublisherComponent.cxx

index 2647118..863f193 100644 (file)
@@ -248,7 +248,7 @@ int AliHLTRawReaderPublisherComponent::GetEvent(const AliHLTComponentEventData&
        continue;
       }
       processedIds.push_back(id);
-      if (readSize<=size-offset) {
+      if (readSize+offset<=size) {
        memcpy(outputPtr+offset, pHeader, sizeof(AliRawDataHeader));
        if (readSize>sizeof(AliRawDataHeader)) {
          if (!pRawReader->ReadNext(outputPtr+offset+sizeof(AliRawDataHeader), readSize-sizeof(AliRawDataHeader))) {