2025-05-07 06:52 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 --suppress=normalCheckLevelConditionExpressions -D__GNUC__ --platform=unix64 -j1 platform: Linux-6.8.0-59-generic-x86_64-with-glibc2.39 python: 3.12.3 client-version: 1.3.67 compiler: g++ (Ubuntu 14.2.0-4ubuntu2~24.04) 14.2.0 cppcheck: head 2.17.0 head-info: 8e656e5 (2025-05-06 23:42:00 +0200) count: 48 48 elapsed-time: 0.6 0.6 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:383:35: error: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] pyethash-0.1.27/src/libethash/internal.c:372:20: note: Assuming allocation function fails pyethash-0.1.27/src/libethash/internal.c:372:20: note: Assignment 'mmapped_data=mmap(NULL,(unsigned long)ret->file_size+8,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)', assigned value is 0 pyethash-0.1.27/src/libethash/internal.c:383:35: note: Null pointer addition 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:87:5: warning: If memory allocation fails, then there is a possible null pointer dereference: s [nullPointerOutOfMemory] pyethash-0.1.27/src/python/core.c:86:15: note: Assuming allocation function fails pyethash-0.1.27/src/python/core.c:86:15: note: Assignment 's=calloc(sizeof(*s),1)', assigned value is 0 pyethash-0.1.27/src/python/core.c:87:5: note: Null pointer dereference pyethash-0.1.27/src/python/core.c:88:5: warning: If memory allocation fails, then there is a possible null pointer dereference: s [nullPointerOutOfMemory] pyethash-0.1.27/src/python/core.c:86:15: note: Assuming allocation function fails pyethash-0.1.27/src/python/core.c:86:15: note: Assignment 's=calloc(sizeof(*s),1)', assigned value is 0 pyethash-0.1.27/src/python/core.c:88:5: note: Null pointer dereference pyethash-0.1.27/src/python/core.c:89:5: warning: If memory allocation fails, then there is a possible null pointer dereference: s [nullPointerOutOfMemory] pyethash-0.1.27/src/python/core.c:86:15: note: Assuming allocation function fails pyethash-0.1.27/src/python/core.c:86:15: note: Assignment 's=calloc(sizeof(*s),1)', assigned value is 0 pyethash-0.1.27/src/python/core.c:89:5: note: Null pointer dereference pyethash-0.1.27/src/python/core.c:92:34: warning: If memory allocation fails, then there is a possible null pointer dereference: h [nullPointerOutOfMemory] pyethash-0.1.27/src/python/core.c:91:15: note: Assuming allocation function fails pyethash-0.1.27/src/python/core.c:91:15: note: Assignment 'h=calloc(sizeof(*h),1)', assigned value is 0 pyethash-0.1.27/src/python/core.c:92:34: note: Null pointer dereference pyethash-0.1.27/src/python/core.c:93:63: warning: If memory allocation fails, then there is a possible null pointer dereference: h [nullPointerOutOfMemory] pyethash-0.1.27/src/python/core.c:91:15: note: Assuming allocation function fails pyethash-0.1.27/src/python/core.c:91:15: note: Assignment 'h=calloc(sizeof(*h),1)', assigned value is 0 pyethash-0.1.27/src/python/core.c:93:63: note: Null pointer dereference 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 pyethash-0.1.27/src/libethash/internal.c:359:43: warning: If memory allocation fails, then there is a possible null pointer dereference: light [ctunullpointerOutOfMemory] pyethash-0.1.27/src/python/core.c:86:15: note: Assuming allocation function fails pyethash-0.1.27/src/python/core.c:86:15: note: Assignment 's=calloc(sizeof(*s),1)', assigned value is 0 pyethash-0.1.27/src/python/core.c:93:58: note: Calling function ethash_light_compute, 1st argument is null pyethash-0.1.27/src/libethash/internal.c:359:43: note: Dereferencing argument light that is null diff: 2.17.0 pyethash-0.1.27/src/libethash/internal.c:383:35: error: If memory allocation fail: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] pyethash-0.1.27/src/libethash/internal.c:372:20: note: Assuming allocation function fails pyethash-0.1.27/src/libethash/internal.c:372:20: note: Assignment 'mmapped_data=mmap(NULL,(unsigned long)ret->file_size+8,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)', assigned value is 0 pyethash-0.1.27/src/libethash/internal.c:383:35: note: Null pointer addition head pyethash-0.1.27/src/libethash/internal.c:383:35: error: If memory allocation fails: pointer addition with NULL pointer. [nullPointerArithmeticOutOfMemory] pyethash-0.1.27/src/libethash/internal.c:372:20: note: Assuming allocation function fails pyethash-0.1.27/src/libethash/internal.c:372:20: note: Assignment 'mmapped_data=mmap(NULL,(unsigned long)ret->file_size+8,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)', assigned value is 0 pyethash-0.1.27/src/libethash/internal.c:383:35: note: Null pointer addition DONE