]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Bug fixed (R.Preghenella)
authordecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Sep 2008 16:47:51 +0000 (16:47 +0000)
committerdecaro <decaro@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Sep 2008 16:47:51 +0000 (16:47 +0000)
TOF/AliTOFtrackerV1.cxx

index 0b0c002a2582ba9e87d677516d8646e326437a55..f405ef5cda2f21fa18b801a0d30ddf7f3a9908fd 100644 (file)
@@ -393,7 +393,8 @@ void AliTOFtrackerV1::MatchTracks( ){
     Int_t index[kncmax];//to keep track of the cluster index
     for (Int_t k=FindClusterIndex(z-dz); k<fN; k++) {  
       AliTOFcluster *c=fClusters[k];
-      if(nc>kncmax)break;
+      //      if(nc>kncmax)break; /* R+ fix (buffer overflow) */
+      if(nc>=kncmax)break; /* R+ fix (buffer overflow protection) */
       if(c->GetZ() > z+dz) break;
       if(c->IsUsed()) continue;      
       if(!c->GetStatus()) {
@@ -434,7 +435,8 @@ void AliTOFtrackerV1::MatchTracks( ){
     AliTOFcluster *bestCluster=0;
     Double_t bestChi2=maxChi2; 
     Int_t idclus=-1;
-    for (Int_t i=0; i<nc; i++){
+    //    for (Int_t i=0; i<nc; i++){ /* R+ fix (unsafe) */
+    for (Int_t i=0; i<nc && i<kncmax; i++){ /* R+ fix (buffer overflow protection) */
       AliTOFcluster *c=clusters[i];  // one of the preselected clusters     
       Double_t chi2=trackTOFin->GetPredictedChi2((AliCluster3D*)c); 
       if (chi2 >= bestChi2) continue;