View Issue Details

IDProjectCategoryView StatusLast Update
0000071Volume 2Bugpublic2019-07-26 10:50
ReporterTafferAssigned ToTaffer 
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
Product VersionIssue 1 
Target VersionIssue 2Fixed in Version 
Summary0000071: code analysis bugs in Common
DescriptionBasic cppcheck issues, same as 0000066; Common gets built as part of dbserver.

Some off these will require a little more thought (the shifts for example) so they do the right thing even on 64-bit systems (assuming they're shifting bare "int" rather than using something more sensible from <stdint.h>).

[auth/authUserData.c:423]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
[auth/authUserData.c:489]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
[auth/authUserData.c:921]: (error) Shifting 32-bit value by 32 bits is undefined behaviour
[auth/authUserData.c:921]: (error) Signed integer overflow for expression '1<<(i/3)'.
[auth/authUserData.c:921]: (error) Signed integer overflow for expression '(1<<(i/3))-1'.
[bases/baselegal.c:613]: (error) Uninitialized variable: fit
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when no macros are defined.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'ATTRIBMOD_H__;ATTRIBMOD_PARSE_INFO_DEFINED;ATTRIBMOD_PARSE_INFO_DEFINITIONS'.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'ATTRIBMOD_H__;ATTRIBMOD_PARSE_INFO_DEFINED;ATTRIBMOD_PARSE_INFO_DEFINITIONS;ATTRIBMOD_PARSE_INFO_DEFINITIONS'.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'ATTRIB_NAMES_H__;ATTRIB_NAMES_PARSE_INFO_DEFINED;ATTRIB_NAMES_PARSE_INFO_DEFINITIONS'.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'ATTRIB_NAMES_H__;ATTRIB_NAMES_PARSE_INFO_DEFINED;ATTRIB_NAMES_PARSE_INFO_DEFINITIONS;ATTRIB_NAMES_PARSE_INFO_DEFINITIONS'.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'BOOST_H__;BOOST_PARSE_INFO_DEFINED;BOOST_PARSE_INFO_DEFINITIONS'.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'BOOST_H__;BOOST_PARSE_INFO_DEFINED;BOOST_PARSE_INFO_DEFINITIONS;BOOST_PARSE_INFO_DEFINITIONS'.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'CHARACTER_ATTRIBS_H__;CHARACTER_ATTRIBS_PARSE_INFO_DEFINED;CHARACTER_ATTRIBS_PARSE_INFO_DEFINITIONS'.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'CHARACTER_ATTRIBS_H__;CHARACTER_ATTRIBS_PARSE_INFO_DEFINED;CHARACTER_ATTRIBS_PARSE_INFO_DEFINITIONS;CHARACTER_ATTRIBS_PARSE_INFO_DEFINITIONS'.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'CLASSES_H__;CLASSES_PARSE_INFO_DEFINED;CLASSES_PARSE_INFO_DEFINITIONS'.
[entity/character_attribs.c:185]: (error) Invalid number of character '{' when these macros are defined: 'CLASSES_H__;CLASSES_PARSE_INFO_DEFINED;CLASSES_PARSE_INFO_DEFINITIONS;CLASSES_PARSE_INFO_DEFINITIONS'.
[entity/character_base.c:1032]: (error) Uninitialized variable: max
[entity/character_base.c:1045]: (error) Uninitialized variable: fMax
[entity/character_base.c:908]: (error) Uninitialized variable: max
[entity/character_base.c:919]: (error) Uninitialized variable: fMax
[entity/character_inventory.c:1875]: (error) Uninitialized variable: res
[entity/costume.c:2398]: (error) failed to expand 'COSTUME_GIVE_TOKEN', Wrong number of parameters for macro 'COSTUME_GIVE_TOKEN'.
[entity/costume.c:3447]: (error) Uninitialized variable: bodytype
[entity/costume.c:3447]: (error) Uninitialized variable: originset
[entity/entity.c:117]: (error) Uninitialized variable: idx
[entity/entworldcoll.c:33]: (error) printf format string requires 6 parameters but only 4 are given.
[entity/entworldcoll.c:40]: (error) printf format string requires 7 parameters but only 5 are given.
[entity/entworldcoll.c:49]: (error) printf format string requires 4 parameters but only 2 are given.
[entity/motion.c:381]: (error) Uninitialized variable: staticEnt
[entity/motion.c:432]: (error) Uninitialized variable: staticEnt
[entity/powers_load.c:661]: (error) Invalid number of character '(' when no macros are defined.
[entity/powers_load.c:661]: (error) Invalid number of character '(' when these macros are defined: 'ATTRIBMOD_H__;ATTRIBMOD_PARSE_INFO_DEFINED;ATTRIBMOD_PARSE_INFO_DEFINITIONS'.
[entity/powers_load.c:661]: (error) Invalid number of character '(' when these macros are defined: 'ATTRIBMOD_H__;ATTRIBMOD_PARSE_INFO_DEFINED;ATTRIBMOD_PARSE_INFO_DEFINITIONS;ATTRIBMOD_PARSE_INFO_DEFINITIONS'.
[entity/powers_load.c:661]: (error) Invalid number of character '(' when these macros are defined: 'BOOST_H__;BOOST_PARSE_INFO_DEFINED;BOOST_PARSE_INFO_DEFINITIONS'.
[entity/powers_load.c:661]: (error) Invalid number of character '(' when these macros are defined: 'BOOST_H__;BOOST_PARSE_INFO_DEFINED;BOOST_PARSE_INFO_DEFINITIONS;BOOST_PARSE_INFO_DEFINITIONS'.
[entity/powers_load.c:661]: (error) Invalid number of character '(' when these macros are defined: 'BOOSTSET_H__;BOOSTSET_PARSE_INFO_DEFINED;BOOSTSET_PARSE_INFO_DEFINITIONS'.
[entity/powers_load.c:661]: (error) Invalid number of character '(' when these macros are defined: 'BOOSTSET_H__;BOOSTSET_PARSE_INFO_DEFINED;BOOSTSET_PARSE_INFO_DEFINITIONS;BOOSTSET_PARSE_INFO_DEFINITIONS'.
[entity/powers_load.c:661]: (error) Invalid number of character '(' when these macros are defined: 'CHARACTER_ATTRIBS_H__;CHARACTER_ATTRIBS_PARSE_INFO_DEFINED;CHARACTER_ATTRIBS_PARSE_INFO_DEFINITIONS'.
[entity/powers_load.c:661]: (error) Invalid number of character '(' when these macros are defined: 'CHARACTER_ATTRIBS_H__;CHARACTER_ATTRIBS_PARSE_INFO_DEFINED;CHARACTER_ATTRIBS_PARSE_INFO_DEFINITIONS;CHARACTER_ATTRIBS_PARSE_INFO_DEFINITIONS'.
[entity/powers_load.c:661]: (error) Invalid number of character '(' when these macros are defined: 'HASH_POWERS'.
[entity/ragdoll.c:159]: (error) Uninitialized variable: mID
[entity/ragdoll.c:209]: (error) Uninitialized variable: mID
[gridcoll/ctri.c:879]: (error) Uninitialized variable: mat
[gridcoll/gridfind.c:71]: (error) Common realloc mistake: 'tags' nulled but not freed upon failure
[group/groupdyn.c:42]: (error) Common realloc mistake: 'dyn_group_status' nulled but not freed upon failure
[group/groupnovodex.c:422]: (error) Uninitialized variable: vMax
[group/groupnovodex.c:422]: (error) Uninitialized variable: vMin
[map.c:172]: (error) No pair for character ("). Can't process file. File is either invalid or unicode, which is currently not supported.
[MissionControl.c:326]: (error) Memory is allocated but not initialized: v
[MissionControl.c:328]: (error) Memory is allocated but not initialized: v
[MissionControl.c:329]: (error) Memory leak: v
[MissionControl.c:351]: (error) Uninitialized variable: rn
[MissionSearch.h:201]: (error) syntax error
[persist/persist.h:6]: (error) syntax error
[seq/AnimBitList.c:223]: (error) Common realloc mistake: 'oldAnimList' nulled but not freed upon failure
[seq/animtrackanimate.c:724]: (error) Common realloc mistake: 'newvals' nulled but not freed upon failure
[seq/animtrackanimate.c:745]: (error) Common realloc mistake: 'newvals' nulled but not freed upon failure
[seq/seqanimate.c:159]: (error) Uninitialized variable: interpolate
[seq/seqanimate.c:159]: (error) Uninitialized variable: newrot
[seq/seqanimate.c:201]: (error) Uninitialized variable: interpolate
[seq/seqanimate.c:73]: (error) Uninitialized variable: qLastRot
[seq/seqregistration.c:586]: (error) Uninitialized variable: matRot
[seq/seqregistration.c:633]: (error) Uninitialized variable: matRot
[seq/seqsequence.c:330]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
[seq/seqskeleton.c:622]: (error) Uninitialized variable: rot
[seq/seqskeleton.c:628]: (error) Uninitialized variable: rot
[seq/seqskeleton.c:637]: (error) Uninitialized variable: rot
[seq/tricks.h:264]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
[seq/tricks.h:286]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
[storyarc/playerCreatedStoryarcValidate.c:1554]: (error) Uninitialized variable: i
[storyarc/playerCreatedStoryarcValidate.c:3183]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
Steps To ReproduceRun:

cppcheck -j8 --output-file=000-cppcheck -I ../Common/account -I ../3rdparty/zeromq2-1/include -I ../libs/UtilitiesLib/UtilsCXX -I ../libs/UtilitiesLib/UtilsNew .

in Common. I've also sorted the output this time for sanity.
TagsNo tags attached.
subsystem

Activities

Cattan

2019-07-26 10:44

administrator   ~0000129

With VS2019 we have even more

Taffer

2019-07-26 10:50

developer   ~0000133

I look forward to seeing the flood of horrors uncovered by VS's Code Analysis tools; it's much more effective than cppcheck, but it'll probably produce a lot more false positives as well.

Issue History

Date Modified Username Field Change
2019-05-09 10:36 Taffer New Issue
2019-05-09 10:36 Taffer Assigned To => Taffer
2019-07-26 10:44 Cattan Note Added: 0000129
2019-07-26 10:50 Taffer Note Added: 0000133