ctest_update: Fix crash when handling svn externals

Refactoring in commit v3.9.0-rc1~156^2 (c++: prefer vectors over lists,
2017-05-04) switched `cmCTestSVN::Repositories` from `std::list` to
`std::vector`.  This can cause re-allocation when svn externals are
processed and break the `RootInfo` pointer that is supposed to point at
the first repository element.  Switch back to `std::list` so that the
address remains stable.

Fixes: #17854
This commit is contained in:
Brad King
2018-03-27 08:41:09 -04:00
parent 75e8af3354
commit 27f033550a

View File

@@ -8,6 +8,7 @@
#include "cmCTestGlobalVC.h"
#include <iosfwd>
#include <list>
#include <string>
#include <vector>
@@ -70,7 +71,8 @@ private:
friend struct Revision;
// Info of all the repositories (root, externals and nested ones).
std::vector<SVNInfo> Repositories;
// Use std::list so the elements don't move in memory.
std::list<SVNInfo> Repositories;
// Pointer to the infos of the root repository.
SVNInfo* RootInfo;