mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 07:11:05 -06:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user