diff options
author | Craig Scott <craig.scott@crascit.com> | 2019-10-28 10:50:09 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-10-28 10:50:22 (GMT) |
commit | cdcc173e236963ad598b098d2d807d0489aa3d42 (patch) | |
tree | 4b6a98ee254b90f50cf1185fca98bd9fcafbfde3 /Source/cmProjectCommand.cxx | |
parent | e03b677e703f84c9d1a2875083d1290db16eb4ad (diff) | |
parent | 82cdb26c93b595e3791818cc8f24dfc6935eb8a8 (diff) | |
download | CMake-cdcc173e236963ad598b098d2d807d0489aa3d42.zip CMake-cdcc173e236963ad598b098d2d807d0489aa3d42.tar.gz CMake-cdcc173e236963ad598b098d2d807d0489aa3d42.tar.bz2 |
Merge topic 'project-version-buffer-overflow'
82cdb26c93 project: Fix potential buffer write-past-end for version components
15a0b0d046 Help: math() expressions must be representable as signed 64-bit
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3948
Diffstat (limited to 'Source/cmProjectCommand.cxx')
-rw-r--r-- | Source/cmProjectCommand.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 1ce6c70..a25fd42 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -229,7 +229,8 @@ bool cmProjectCommand(std::vector<std::string> const& args, std::array<std::string, MAX_VERSION_COMPONENTS> version_components; if (cmp0096 == cmPolicies::OLD || cmp0096 == cmPolicies::WARN) { - char vb[MAX_VERSION_COMPONENTS][std::numeric_limits<unsigned>::digits10]; + char vb[MAX_VERSION_COMPONENTS] + [std::numeric_limits<unsigned>::digits10 + 2]; unsigned v[MAX_VERSION_COMPONENTS] = { 0, 0, 0, 0 }; const int vc = std::sscanf(version.c_str(), "%u.%u.%u.%u", &v[0], &v[1], &v[2], &v[3]); |