How can I get Coverity to that the condition !pHost should not be evaluated any further due to the return statement?
bool mudlet::setWindowFont(Host* pHost, const QString& window, const QString& font)
1359{
1. Condition !pHost, taking false branch.
1360 if (!pHost) {
1361 return false;
1362 }
1363
1364 QMap<QString, TConsole*>& dockWindowConsoleMap = mHostConsoleMap[pHost];
1365
2. Condition dockWindowConsoleMap->contains(window), taking true branch.
1366 if (dockWindowConsoleMap.contains(window)) {
3. assign_zero: Assigning: <temporary> = NULL.
4. identity_transfer: Passing TConsole * const(NULL) as argument 2 to member function value, which returns that argument.
5. alias_transfer: Assigning: pC = dockWindowConsoleMap->value(window, TConsole * const(NULL)).
1367 TConsole* pC = dockWindowConsoleMap.value(window);
CID 1468654 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)6. var_deref_model: Passing null pointer pC to setMiniConsoleFont, which dereferences it. [show details]
I don't think that Coverity is complaining about pHost being null. I think that it is just telling you that it analyzed the rest of the function under the situation where !pHost is false.
It looks like Coverity is telling you that the pointer pC will be null after calling dockWindowConsoleMap.value() because that function returns the 2nd argument (which has defaulted to null since you didn't provide it). Then Coverity thinks that you are using pC as an input to setMiniConsoleFont which will dereference it.
You might want to look at the source for dockWindowConsoleMap.value() to see how its return value relates to that optional 2nd argument and also look at setMiniConsoleFont to see how it dereferences its input.