Commit 90c2f138 authored by Craig Scott's avatar Craig Scott
Browse files

CPackIFWInstaller: Avoid potential null pointer dereference

In d1683032 (CPackIFW: Improve warning and docs for show page list
option, 2021-02-14), code was added to report the current QtIFW version.
That code didn't check that there was a Generator object before using it,
resulting in a scanbuild warning about a potential null pointer dereference.
Add a check and output a more general warning message if we don't have
the current QtIFW version available to report.
parent 50fc9d5b
Pipeline #215083 passed with stages
in 55 minutes and 45 seconds
......@@ -186,13 +186,20 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
} else {
std::string currentVersionMsg;
if (this->Generator) {
currentVersionMsg =
"QtIFW version " + this->Generator->FrameworkVersion;
} else {
currentVersionMsg = "an older QtIFW version";
<< option
<< "\", but it is only supported with QtIFW version 4.0 or later. "
"It is being ignored because you are using QtIFW version "
<< this->Generator-> << std::endl);
"It is being ignored because you are using "
<< currentVersionMsg << std::endl);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment