Skip to content

Commit

Permalink
Vector must be resized to prevent bounds-checking assertion failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
simpsonst committed Mar 1, 2022
1 parent 95daa61 commit 5ea2004
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/XrdTpc/XrdTpcStream.hh
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ private:
}

// Inflate the underlying buffer if needed.
ssize_t new_bytes_needed = (m_size + size) - m_buffer.capacity();
ssize_t new_bytes_needed = (m_size + size) - m_buffer.size();
if (new_bytes_needed > 0) {
m_buffer.reserve(m_capacity);
m_buffer.resize(m_capacity);
}

// Finally, do the copy.
Expand Down

0 comments on commit 5ea2004

Please sign in to comment.