2024-04-03 14:18 ftp://ftp.de.debian.org/debian/pool/main/p/pyethash/pyethash_0.1.27.orig.tar.gz cppcheck-options: --library=posix --library=gnu --library=bsd --library=python --inconclusive --enable=style,information --inline-suppr --template=daca2 --disable=missingInclude --suppress=unmatchedSuppression --check-library --debug-warnings --suppress=autoNoType --suppress=valueFlowBailout --suppress=bailoutUninitVar --suppress=symbolDatabaseWarning -D__GNUC__ --platform=unix64 -j1 platform: Linux-5.15.0-101-generic-x86_64-with-glibc2.35 python: 3.10.12 client-version: 1.3.55 compiler: g++ (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0 cppcheck: head 2.13.0 head-info: f94a60d (2024-04-03 11:44:14 +0200) count: 41 36 elapsed-time: 1.3 1.0 head-timing-info: old-timing-info: head results: pyethash-0.1.27/src/libethash/io.h:197:72: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PRIx64 [valueFlowBailoutIncompleteVar] pyethash-0.1.27/src/libethash/internal.c:367:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] pyethash-0.1.27/src/libethash/internal.c:209:16: error: Using pointer to local variable 'tmp_node' that is out of scope. [invalidLifetime] pyethash-0.1.27/src/libethash/internal.c:215:16: note: Address of variable taken here. pyethash-0.1.27/src/libethash/internal.c:213:10: note: Variable created here. pyethash-0.1.27/src/libethash/internal.c:209:16: note: Using pointer to local variable 'tmp_node' that is out of scope. pyethash-0.1.27/src/libethash/internal.c:233:50: error: Using pointer to local variable 'tmp_node' that is out of scope. [invalidLifetime] pyethash-0.1.27/src/libethash/internal.c:215:16: note: Address of variable taken here. pyethash-0.1.27/src/libethash/internal.c:213:10: note: Variable created here. pyethash-0.1.27/src/libethash/internal.c:233:50: note: Using pointer to local variable 'tmp_node' that is out of scope. pyethash-0.1.27/src/libethash/internal.c:199:13: error: Array 'mix->words[16]' accessed at index 31, which is out of bounds. [arrayIndexOutOfBounds] pyethash-0.1.27/src/libethash/internal.c:206:66: error: Array 'mix->words[16]' accessed at index 31, which is out of bounds. [arrayIndexOutOfBounds] pyethash-0.1.27/src/libethash/internal.c:243:34: error: Array 'mix->words[16]' accessed at index 28, which is out of bounds. [arrayIndexOutOfBounds] pyethash-0.1.27/src/libethash/internal.c:244:49: error: Array 'mix->words[16]' accessed at index 29, which is out of bounds. [arrayIndexOutOfBounds] pyethash-0.1.27/src/libethash/internal.c:245:49: error: Array 'mix->words[16]' accessed at index 30, which is out of bounds. [arrayIndexOutOfBounds] pyethash-0.1.27/src/libethash/internal.c:246:49: error: Array 'mix->words[16]' accessed at index 31, which is out of bounds. [arrayIndexOutOfBounds] pyethash-0.1.27/src/libethash/internal.c:384:2: error: Memory leak: mmapped_data [memleak] pyethash-0.1.27/src/libethash/internal.c:96:23: style:inconclusive: Function 'ethash_calculate_dag_item' argument 3 names different: declaration 'cache' definition 'light'. [funcArgNamesDifferent] pyethash-0.1.27/src/libethash/internal.h:148:23: note: Function 'ethash_calculate_dag_item' argument 3 names different: declaration 'cache' definition 'light'. pyethash-0.1.27/src/libethash/internal.c:96:23: note: Function 'ethash_calculate_dag_item' argument 3 names different: declaration 'cache' definition 'light'. pyethash-0.1.27/src/libethash/internal.c:258:17: style: Parameter 'return_hash' can be declared as pointer to const [constParameterPointer] pyethash-0.1.27/src/libethash/internal.c:270:11: warning: Uninitialized variable: return_hash [uninitvar] pyethash-0.1.27/src/libethash/internal.c:292:20: note: Calling function 'ethash_quick_hash', 1st argument '&return_hash' value is pyethash-0.1.27/src/libethash/internal.c:270:11: note: Uninitialized variable: return_hash pyethash-0.1.27/src/libethash/io.c:37:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] pyethash-0.1.27/src/libethash/io.c:112:2: style:inconclusive: Statements following 'goto' will never be executed. [unreachableCode] pyethash-0.1.27/src/libethash/io_posix.c:44:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable S_IRWXU [valueFlowBailoutIncompleteVar] pyethash-0.1.27/src/libethash/io_posix.c:96:24: portability: Non reentrant function 'getpwuid' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwuid_r'. [prohibitedgetpwuidCalled] pyethash-0.1.27/src/libethash/io_posix.c:61:22: style: Condition 'dirname[dirlen]!='/'' is always true [knownConditionTrueFalse] pyethash-0.1.27/src/libethash/io_posix.c:59:16: note: dirlen is assigned 'strlen(dirname)' here. pyethash-0.1.27/src/libethash/io_posix.c:59:24: note: Return index of first '\0' character in string pyethash-0.1.27/src/libethash/io_posix.c:61:22: note: Condition 'dirname[dirlen]!='/'' is always true pyethash-0.1.27/src/libethash/io_posix.c:71:22: style: Condition 'dirname[dirlen]!='/'' is always true [knownConditionTrueFalse] pyethash-0.1.27/src/libethash/io_posix.c:59:16: note: dirlen is assigned 'strlen(dirname)' here. pyethash-0.1.27/src/libethash/io_posix.c:65:6: note: Assuming condition is false pyethash-0.1.27/src/libethash/io_posix.c:59:24: note: Return index of first '\0' character in string pyethash-0.1.27/src/libethash/io_posix.c:71:22: note: Condition 'dirname[dirlen]!='/'' is always true pyethash-0.1.27/src/libethash/io_posix.c:105:20: style: Condition 'home_dir[len]!='/'' is always true [knownConditionTrueFalse] pyethash-0.1.27/src/libethash/io_posix.c:101:13: note: len is assigned 'strlen(home_dir)' here. pyethash-0.1.27/src/libethash/io_posix.c:102:6: note: Assuming condition is false pyethash-0.1.27/src/libethash/io_posix.c:101:21: note: Return index of first '\0' character in string pyethash-0.1.27/src/libethash/io_posix.c:105:20: note: Condition 'home_dir[len]!='/'' is always true pyethash-0.1.27/src/libethash/io_posix.c:93:8: style: Variable 'home_dir' can be declared as pointer to const [constVariablePointer] pyethash-0.1.27/src/libethash/io_posix.c:96:18: style: Variable 'pwd' can be declared as pointer to const [constVariablePointer] pyethash-0.1.27/src/libethash/sha3.c:55:3: style: Variable 'y' is reassigned a value before the old one has been used. [redundantAssignment] pyethash-0.1.27/src/libethash/sha3.c:55:3: note: y is assigned pyethash-0.1.27/src/libethash/sha3.c:55:3: note: y is overwritten pyethash-0.1.27/src/libethash/sha3.c:59:3: style: Variable 'y' is reassigned a value before the old one has been used. [redundantAssignment] pyethash-0.1.27/src/libethash/sha3.c:55:3: note: y is assigned pyethash-0.1.27/src/libethash/sha3.c:59:3: note: y is overwritten pyethash-0.1.27/src/libethash/sha3.c:59:3: style: Variable 'x' is reassigned a value before the old one has been used. [redundantAssignment] pyethash-0.1.27/src/libethash/sha3.c:55:3: note: x is assigned pyethash-0.1.27/src/libethash/sha3.c:59:3: note: x is overwritten pyethash-0.1.27/src/libethash/sha3.c:59:3: style: Variable 'y' is reassigned a value before the old one has been used. [redundantAssignment] pyethash-0.1.27/src/libethash/sha3.c:59:3: note: y is assigned pyethash-0.1.27/src/libethash/sha3.c:59:3: note: y is overwritten pyethash-0.1.27/src/libethash/sha3.c:70:3: style: Variable 'y' is reassigned a value before the old one has been used. [redundantAssignment] pyethash-0.1.27/src/libethash/sha3.c:59:3: note: y is assigned pyethash-0.1.27/src/libethash/sha3.c:70:3: note: y is overwritten pyethash-0.1.27/src/libethash/sha3.c:64:5: style: Variable 'x' is reassigned a value before the old one has been used. [redundantAssignment] pyethash-0.1.27/src/libethash/sha3.c:59:3: note: x is assigned pyethash-0.1.27/src/libethash/sha3.c:64:5: note: x is overwritten pyethash-0.1.27/src/libethash/sha3.c:70:3: style: Variable 'x' is reassigned a value before the old one has been used. [redundantAssignment] pyethash-0.1.27/src/libethash/sha3.c:65:3: note: x is assigned pyethash-0.1.27/src/libethash/sha3.c:70:3: note: x is overwritten pyethash-0.1.27/src/libethash/sha3.c:70:3: style: Variable 'x' is reassigned a value before the old one has been used. [redundantAssignment] pyethash-0.1.27/src/libethash/sha3.c:70:3: note: x is assigned pyethash-0.1.27/src/libethash/sha3.c:70:3: note: x is overwritten pyethash-0.1.27/src/libethash/sha3.c:50:13: style: Variable 't' is assigned a value that is never used. [unreadVariable] pyethash-0.1.27/src/libethash/sha3.c:65:3: style: Variable 't' is assigned a value that is never used. [unreadVariable] pyethash-0.1.27/src/libethash/sha3.c:70:3: style: Variable 'x' is assigned a value that is never used. [unreadVariable] pyethash-0.1.27/src/libethash/sha3.c:70:3: style: Variable 'y' is assigned a value that is never used. [unreadVariable] pyethash-0.1.27/src/libethash/sha3_cryptopp.cpp:30:39: style: C-style pointer casting [cstyleCast] pyethash-0.1.27/src/python/core.c:82:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PyExc_ValueError [valueFlowBailoutIncompleteVar] pyethash-0.1.27/src/python/core.c:195:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PyExc_ValueError [valueFlowBailoutIncompleteVar] pyethash-0.1.27/src/python/core.c:193:9: warning: %i in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint] pyethash-0.1.27/src/python/core.c:22:19: style: Unused variable: cache_size [unusedVariable] pyethash-0.1.27/src/libethash/internal.c:99:42: error: Null pointer dereference: light [ctunullpointer] pyethash-0.1.27/src/libethash/internal.c:487:18: note: Calling function ethash_hash, 3rd argument is null pyethash-0.1.27/src/libethash/internal.c:214:5: note: Calling function ethash_calculate_dag_item, 3rd argument is null pyethash-0.1.27/src/libethash/internal.c:99:42: note: Dereferencing argument light that is null diff: head pyethash-0.1.27/src/libethash/internal.c:270:11: warning: Uninitialized variable: return_hash [uninitvar] pyethash-0.1.27/src/libethash/internal.c:292:20: note: Calling function 'ethash_quick_hash', 1st argument '&return_hash' value is pyethash-0.1.27/src/libethash/internal.c:270:11: note: Uninitialized variable: return_hash head pyethash-0.1.27/src/libethash/internal.c:367:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] head pyethash-0.1.27/src/libethash/io.c:37:2: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable errno [valueFlowBailoutIncompleteVar] head pyethash-0.1.27/src/libethash/io_posix.c:44:26: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable S_IRWXU [valueFlowBailoutIncompleteVar] head pyethash-0.1.27/src/python/core.c:195:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable PyExc_ValueError [valueFlowBailoutIncompleteVar] DONE