summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-22 14:09:51 (GMT)
committerBrad King <brad.king@kitware.com>2023-11-22 14:53:26 (GMT)
commit5c77facd7826f285fbf4d553160d1a542d60942b (patch)
treef78a06ef7d5d999a7d5cd7dddc04703440156e00 /Source
parente68e7b176808c6c8b226c15a80d6632fc2b73751 (diff)
downloadCMake-5c77facd7826f285fbf4d553160d1a542d60942b.zip
CMake-5c77facd7826f285fbf4d553160d1a542d60942b.tar.gz
CMake-5c77facd7826f285fbf4d553160d1a542d60942b.tar.bz2
VS: Fix Intel plugin version detection fallback
Do not read a value that was not parsed.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 1abdd0b..9739a09 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -94,8 +94,8 @@ const std::string& cmGlobalVisualStudio7Generator::GetIntelProjectVersion()
cmSystemTools::ReadRegistryValue(vskey, intelVersion,
cmSystemTools::KeyWOW64_32);
unsigned int intelVersionNumber = ~0u;
- sscanf(intelVersion.c_str(), "%u", &intelVersionNumber);
- if (intelVersionNumber >= 11) {
+ if (sscanf(intelVersion.c_str(), "%u", &intelVersionNumber) != 1 ||
+ intelVersionNumber >= 11) {
// Default to latest known project file version.
intelVersion = "11.0";
} else if (intelVersionNumber == 10) {