diff options
author | Brad King <brad.king@kitware.com> | 2016-08-30 13:29:49 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-08-30 13:29:49 (GMT) |
commit | ef58e97362d10877780aed7b6806dd02ce2f4303 (patch) | |
tree | 8b2d2527e455b9fa8b68d6d4a2e34f154ae1fa8c /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 388a40942bbe87206547bd9eb27273f80ef2aa9f (diff) | |
parent | 1f4aeb1739fb632ab5162a977764b51736728edc (diff) | |
download | CMake-ef58e97362d10877780aed7b6806dd02ce2f4303.zip CMake-ef58e97362d10877780aed7b6806dd02ce2f4303.tar.gz CMake-ef58e97362d10877780aed7b6806dd02ce2f4303.tar.bz2 |
Merge topic 'vs-NsightTegra-empty-version'
1f4aeb17 VS: Fix out-of-bounds write on empty Nsight Tegra version
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 1b1d04b..5ce88f6 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -185,13 +185,12 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator( this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str()); this->Platform = gg->GetPlatformName(); this->NsightTegra = gg->IsNsightTegra(); - for (int i = - sscanf(gg->GetNsightTegraVersion().c_str(), "%u.%u.%u.%u", - &this->NsightTegraVersion[0], &this->NsightTegraVersion[1], - &this->NsightTegraVersion[2], &this->NsightTegraVersion[3]); - i < 4; ++i) { + for (int i = 0; i < 4; ++i) { this->NsightTegraVersion[i] = 0; } + sscanf(gg->GetNsightTegraVersion().c_str(), "%u.%u.%u.%u", + &this->NsightTegraVersion[0], &this->NsightTegraVersion[1], + &this->NsightTegraVersion[2], &this->NsightTegraVersion[3]); this->MSTools = !this->NsightTegra; this->TargetCompileAsWinRT = false; this->BuildFileStream = 0; |