2025-07-14 22:32 ftp://ftp.de.debian.org/debian/pool/main/m/moon-lander/moon-lander_1.0.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --inconclusive --enable=style,information --inline-suppr --template=daca2 --disable=missingInclude --suppress=unmatchedSuppression --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning --suppress=normalCheckLevelConditionExpressions -D__GNUC__ --platform=unix64 -j3 platform: Linux-6.8.0-63-generic-x86_64-with-glibc2.39 python: 3.12.3 client-version: 1.3.67 compiler: g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 cppcheck: head 2.17.0 head-info: a2600d0 (2025-07-14 12:39:20 +0200) count: 51 50 elapsed-time: 0.7 0.7 head-timing-info: old-timing-info: head results: moon-lander/DT_drawtext.c:35:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_BYTEORDER [valueFlowBailoutIncompleteVar] moon-lander/DT_drawtext.c:67:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_BYTEORDER [valueFlowBailoutIncompleteVar] moon-lander/DT_drawtext.c:99:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] moon-lander/DT_drawtext.c:170:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable flags [valueFlowBailoutIncompleteVar] moon-lander/DT_drawtext.c:226:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_OPENGLBLIT [valueFlowBailoutIncompleteVar] moon-lander/DT_drawtext.c:155:3: warning: If memory allocation fails, then there is a possible null pointer dereference: *CurrentFont [nullPointerOutOfMemory] moon-lander/DT_drawtext.c:153:33: note: Assuming allocation function fails moon-lander/DT_drawtext.c:153:17: note: Assignment '*CurrentFont=(struct BitFont*)malloc(sizeof(struct BitFont))', assigned value is 0 moon-lander/DT_drawtext.c:155:3: note: Null pointer dereference moon-lander/game_lib.c:23:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_MOUSEMOTION [valueFlowBailoutIncompleteVar] moon-lander/game_lib.c:40:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_INIT_VIDEO [valueFlowBailoutIncompleteVar] moon-lander/game_lib.c:115:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] moon-lander/game_lib.c:157:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_SRCCOLORKEY [valueFlowBailoutIncompleteVar] moon-lander/game_lib.c:183:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] moon-lander/game_lib.c:322:8: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_BYTEORDER [valueFlowBailoutIncompleteVar] moon-lander/game_lib.c:358:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_QUIT [valueFlowBailoutIncompleteVar] moon-lander/DT_drawtext.c:266:11: style: Variable 'temp' can be declared as pointer to const [constVariablePointer] moon-lander/DT_drawtext.c:273:9: style: Variable 'temp' is assigned a value that is never used. [unreadVariable] moon-lander/game_lib.c:103:25: style:inconclusive: Function 'new_sprite' argument 1 names different: declaration 's' definition 'temp'. [funcArgNamesDifferent] moon-lander/gamelib.h:36:25: note: Function 'new_sprite' argument 1 names different: declaration 's' definition 'temp'. moon-lander/game_lib.c:103:25: note: Function 'new_sprite' argument 1 names different: declaration 's' definition 'temp'. moon-lander/moon_lander.c:145:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_QUIT [valueFlowBailoutIncompleteVar] moon-lander/moon_lander.c:243:80: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable d_name [valueFlowBailoutIncompleteVar] moon-lander/moon_lander.c:369:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_QUIT [valueFlowBailoutIncompleteVar] moon-lander/moon_lander.c:574:15: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] moon-lander/moon_lander.c:974:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_QUIT [valueFlowBailoutIncompleteVar] moon-lander/moon_lander.c:1450:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable SDL_QUIT [valueFlowBailoutIncompleteVar] moon-lander/moon_lander.c:1173:20: error: Array 'game->explosion[25]' accessed at index 25, which is out of bounds. [arrayIndexOutOfBounds] moon-lander/moon_lander.c:1172:25: note: Assuming that condition 'count<27' is not redundant moon-lander/moon_lander.c:1173:20: note: Array index out of bounds moon-lander/moon_lander.c:1173:86: error: Array 'game->explosion[25]' accessed at index 25, which is out of bounds. [arrayIndexOutOfBounds] moon-lander/moon_lander.c:1172:25: note: Assuming that condition 'count<27' is not redundant moon-lander/moon_lander.c:1173:86: note: Array index out of bounds moon-lander/moon_lander.c:1174:20: error: Array 'game->explosion[25]' accessed at index 25, which is out of bounds. [arrayIndexOutOfBounds] moon-lander/moon_lander.c:1172:25: note: Assuming that condition 'count<27' is not redundant moon-lander/moon_lander.c:1174:20: note: Array index out of bounds moon-lander/moon_lander.c:1174:86: error: Array 'game->explosion[25]' accessed at index 25, which is out of bounds. [arrayIndexOutOfBounds] moon-lander/moon_lander.c:1172:25: note: Assuming that condition 'count<27' is not redundant moon-lander/moon_lander.c:1174:86: note: Array index out of bounds moon-lander/moon_lander.c:447:10: error: Buffer is accessed out of bounds: selected_text [bufferAccessOutOfBounds] moon-lander/moon_lander.c:450:10: error: Buffer is accessed out of bounds: selected_text [bufferAccessOutOfBounds] moon-lander/moon_lander.c:264:16: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] moon-lander/moon_lander.c:303:16: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] moon-lander/moon_lander.c:787:3: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] moon-lander/moon_lander.c:289:10: warning: Either the condition '(file=fopen(filename,"w"))!=NULL' is redundant or there is possible null pointer dereference: file. [nullPointerRedundantCheck] moon-lander/moon_lander.c:279:38: note: Assuming that condition '(file=fopen(filename,"w"))!=NULL' is not redundant moon-lander/moon_lander.c:289:10: note: Null pointer dereference moon-lander/moon_lander.c:138:10: style: Variable 'key_table' can be declared as pointer to const [constVariablePointer] moon-lander/moon_lander.c:255:22: style: Parameter 'game' can be declared as pointer to const [constParameterPointer] moon-lander/moon_lander.c:260:18: style: Variable 'pwp' can be declared as pointer to const [constVariablePointer] moon-lander/moon_lander.c:300:18: style: Variable 'pwp' can be declared as pointer to const [constVariablePointer] moon-lander/moon_lander.c:352:10: style: Variable 'key_table' can be declared as pointer to const [constVariablePointer] moon-lander/moon_lander.c:838:10: style: Variable 'key_table' can be declared as pointer to const [constVariablePointer] moon-lander/moon_lander.c:1420:10: style: Variable 'key_table' can be declared as pointer to const [constVariablePointer] moon-lander/moon_lander.c:538:9: style: Variable 'x' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:540:10: style: Variable 'yd' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:541:12: style: Variable 'miny' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:542:12: style: Variable 'maxy' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:544:12: style: Variable 'size' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:545:11: style: Variable 'max' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:1411:12: style: Variable 'down' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:1412:12: style: Variable 'left' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:1413:13: style: Variable 'right' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:1415:16: style: Variable 'engine_on' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:1417:10: style: Variable 'won' is assigned a value that is never used. [unreadVariable] moon-lander/moon_lander.c:1678:15: style: Variable 'won' is assigned a value that is never used. [unreadVariable] diff: head moon-lander/moon_lander.c:1173:86: error: Array 'game->explosion[25]' accessed at index 25, which is out of bounds. [arrayIndexOutOfBounds] moon-lander/moon_lander.c:1172:25: note: Assuming that condition 'count<27' is not redundant moon-lander/moon_lander.c:1173:86: note: Array index out of bounds head moon-lander/moon_lander.c:1174:86: error: Array 'game->explosion[25]' accessed at index 25, which is out of bounds. [arrayIndexOutOfBounds] moon-lander/moon_lander.c:1172:25: note: Assuming that condition 'count<27' is not redundant moon-lander/moon_lander.c:1174:86: note: Array index out of bounds 2.17.0 moon-lander/moon_lander.c:197:27: portability: Non reentrant function 'readdir' called. For threadsafe applications it is recommended to use the reentrant replacement function 'readdir_r'. [prohibitedreaddirCalled] DONE