Skip to content

Commit

Permalink
fix: Potential Out of Bounds in Root file reading (#3870)
Browse files Browse the repository at this point in the history
Fix possible Out of Bounds access on data filled by ROOT
The data output by `->Draw` is guaranteed to be properly initialized
and filled
  • Loading branch information
dave7895 authored Nov 18, 2024
1 parent 68226ec commit f99c9fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Examples/Io/Root/src/RootMaterialTrackReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ RootMaterialTrackReader::RootMaterialTrackReader(const Config& config,

// Sort the entry numbers of the events
{
// necessary to guarantee that m_inputChain->GetV1() is valid for the
// entire range
m_inputChain->SetEstimate(nentries);

m_entryNumbers.resize(nentries);
m_inputChain->Draw("event_id", "", "goff");
RootUtility::stableSort(m_inputChain->GetEntries(), m_inputChain->GetV1(),
Expand Down

0 comments on commit f99c9fa

Please sign in to comment.