cppcheck/lib
orbitcowboy ee1ba85e15
symboldatabase: Fix potential null pointer dereference (#1072)
There is a  potential `nullPointer` dereference in symboldatabase. This PR attempts to fix this. Additionally, this could be detected by Cppcheck as well. 

Here is a reduced and compilable testcase, where Cppcheck fails to detect a potential `nullPointer` dereference:

```
class Scope
{
public:
    bool bar();
    int *definedType;
};

int f(Scope *new_scope)
{
    int ret = 1;
    if (new_scope)
    {
        if (new_scope->bar())
        {
            if (!new_scope->definedType) {} // check for null
            ret = *new_scope->definedType; // dereference
        }
    }
    return ret;
}
```
The corresponding ticket on track, addressing the false negative: https://trac.cppcheck.net/ticket/8375
2018-01-31 11:00:42 +01:00
..
CMakeLists.txt Fixed #7660 (cmake build does not handle simplecpp) 2016-08-06 18:21:54 +02:00
analyzerinfo.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
analyzerinfo.h Updated copyright year 2018-01-14 15:37:52 +01:00
astutils.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
astutils.h Updated copyright year 2018-01-14 15:37:52 +01:00
check.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
check.h Updated copyright year 2018-01-14 15:37:52 +01:00
check64bit.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
check64bit.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkassert.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkassert.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkautovariables.cpp Fixed #8325 (False negative: address of auto variable being returned when assigned to another variable first) 2018-01-27 14:48:45 +01:00
checkautovariables.h Fixed #8325 (False negative: address of auto variable being returned when assigned to another variable first) 2018-01-27 14:48:45 +01:00
checkbool.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkbool.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkboost.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkboost.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkbufferoverrun.cpp Pointer overflow: Fixed false positive 2018-01-27 22:09:43 +01:00
checkbufferoverrun.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkclass.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkclass.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkcondition.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkcondition.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkexceptionsafety.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkexceptionsafety.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkfunctions.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkfunctions.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkinternal.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkinternal.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkio.cpp checkio: Fixed potential usage of invalid iterator. (#1066) 2018-01-30 08:43:15 +01:00
checkio.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkleakautovar.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkleakautovar.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkmemoryleak.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkmemoryleak.h Updated copyright year 2018-01-14 15:37:52 +01:00
checknullpointer.cpp Refactoring whole program analysis for CheckUninitVar and CheckNullPointer 2018-01-21 22:56:46 +01:00
checknullpointer.h Refactoring whole program analysis for CheckUninitVar and CheckNullPointer 2018-01-21 22:56:46 +01:00
checkother.cpp checkother: Removed statement that is always true. (#1059) 2018-01-26 22:49:07 +01:00
checkother.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkpostfixoperator.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkpostfixoperator.h Fixed #8350 (False positive: enum class static_cast to int is treated as non-primitive when type inference is used) (#1042) 2018-01-21 07:26:37 +01:00
checksizeof.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checksizeof.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkstl.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkstl.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkstring.cpp Cleanup not needed variable. 2018-01-19 22:41:51 +01:00
checkstring.h Fix Cppcheck warning about mismatching argument names 2018-01-15 22:25:55 +01:00
checktype.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checktype.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkuninitvar.cpp UninitVar: Speedup whole program analysis a bit 2018-01-29 15:15:35 +01:00
checkuninitvar.h UninitVar: Improve whole program analysis, used isVariableUsage() 2018-01-25 21:49:21 +01:00
checkunusedfunctions.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkunusedfunctions.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkunusedvar.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkunusedvar.h Updated copyright year 2018-01-14 15:37:52 +01:00
checkvaarg.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
checkvaarg.h Updated copyright year 2018-01-14 15:37:52 +01:00
config.h Removed non-standard code annotations with __attribute__ 2016-01-09 09:33:56 +01:00
cppcheck.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
cppcheck.h Updated copyright year 2018-01-14 15:37:52 +01:00
cppcheck.natvis Added cppcheck.natvis file for human readable debug information in Visual Studio. 2017-01-22 10:21:29 +01:00
cppcheck.vcxproj also generate debug information when building for release. This makes (#1003) 2017-11-29 08:31:30 +01:00
cppcheck.vcxproj.filters Fixed travis build by replacing Token::Match by simpleMatch() 2017-03-16 21:15:10 +01:00
cxx11emu.h Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
errorlogger.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
errorlogger.h Updated copyright year 2018-01-14 15:37:52 +01:00
importproject.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
importproject.h Updated copyright year 2018-01-14 15:37:52 +01:00
lib.pri Added --cppcheck-build-dir flag 2016-10-29 12:18:11 +02:00
library.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
library.h Updated copyright year 2018-01-14 15:37:52 +01:00
matchcompiler.h Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
mathlib.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
mathlib.h Updated copyright year 2018-01-14 15:37:52 +01:00
path.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
path.h Updated copyright year 2018-01-14 15:37:52 +01:00
pathmatch.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
pathmatch.h Updated copyright year 2018-01-14 15:37:52 +01:00
pcrerules.pri
platform.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
platform.h Updated copyright year 2018-01-14 15:37:52 +01:00
preprocessor.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
preprocessor.h Updated copyright year 2018-01-14 15:37:52 +01:00
settings.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
settings.h Updated copyright year 2018-01-14 15:37:52 +01:00
standards.h Updated copyright year 2018-01-14 15:37:52 +01:00
suppressions.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
suppressions.h Updated copyright year 2018-01-14 15:37:52 +01:00
symboldatabase.cpp symboldatabase: Fix potential null pointer dereference (#1072) 2018-01-31 11:00:42 +01:00
symboldatabase.h Updated copyright year 2018-01-14 15:37:52 +01:00
templatesimplifier.cpp templatesimplifier: Removed redundant local string variable. (#1041) 2018-01-20 22:26:48 +01:00
templatesimplifier.h Updated copyright year 2018-01-14 15:37:52 +01:00
timer.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
timer.h Updated copyright year 2018-01-14 15:37:52 +01:00
token.cpp token: Fixed potential null pointer dereference. (#1062) 2018-01-28 14:27:01 +01:00
token.h Updated copyright year 2018-01-14 15:37:52 +01:00
tokenize.cpp Tokenizer: Refactoring garbage check 2018-01-27 22:26:43 +01:00
tokenize.h gui: update copyright message in about dialog 2018-01-14 15:46:20 +01:00
tokenlist.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
tokenlist.h Updated copyright year 2018-01-14 15:37:52 +01:00
utils.h Updated copyright year 2018-01-14 15:37:52 +01:00
valueflow.cpp Updated copyright year 2018-01-14 15:37:52 +01:00
valueflow.h Updated copyright year 2018-01-14 15:37:52 +01:00
version.h 1.82: Updated versions 2018-01-14 16:25:17 +01:00
version.rc