adding protection in copy constructor: check for source array size
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Nov 2009 09:38:08 +0000 (09:38 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Nov 2009 09:38:08 +0000 (09:38 +0000)
HLT/BASE/AliHLTCTPData.cxx

index c930a2a..d6a8724 100644 (file)
@@ -85,6 +85,7 @@ AliHLTCTPData& AliHLTCTPData::operator=(const AliHLTCTPData& src)
     fClassIds.Delete();
     fClassIds.ExpandCreate(gkNCTPTriggerClasses);
     for (int i=0; i<gkNCTPTriggerClasses; i++) {
+      if (i>src.fClassIds.GetLast()) break;
       ((TNamed*)fClassIds.At(i))->SetName(src.fClassIds.At(i)->GetName());
       ((TNamed*)fClassIds.At(i))->SetTitle(src.fClassIds.At(i)->GetTitle());
     }