Skip to content

Commit

Permalink
fixed a possible array overflow and memory corruption in dicom reader
Browse files Browse the repository at this point in the history
  • Loading branch information
denisri committed Nov 17, 2022
1 parent f70666e commit c0de846
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/somadicom/Dicom/MultiFileReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,11 @@ bool dcm::MultiFileReader::sortFiles( dcm::DicomDatasetHeader& datasetHeader )

while ( f != fe )
{

if( lut.size() <= pos )
lut.resize( pos + 1 );
lut[ pos ] = f->second._bufferIndex;
if( _positions.size() <= pos )
_positions.resize( pos + 1 );
_positions[ pos ] = f->second._imagePosition;

pos += dimZ;
Expand Down

0 comments on commit c0de846

Please sign in to comment.