2022-06-25 03:37 ftp://ftp.de.debian.org/debian/pool/main/s/scanmem/scanmem_0.17.orig.tar.gz cppcheck-options: --library=posix --library=gnu --showtime=top5 --check-library --inconclusive --enable=style,information --template=daca2 -D__GNUC__ --platform=unix64 -rp=temp -j2 platform: Linux-5.4.0-110-generic-x86_64-with-glibc2.29 python: 3.8.10 client-version: 1.3.24 compiler: g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 cppcheck: head 2.8 head-info: 11860cc (2022-06-24 13:55:04 +0200) count: 50 51 elapsed-time: 4.8 4.8 head-timing-info: Overall time: 0s old-timing-info: Overall time: 0s head results: scanmem-0.17/commands.c:104:17: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/commands.c:116:28: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] scanmem-0.17/commands.c:110:14: error: Common realloc mistake: 'argv' nulled but not freed upon failure [memleakOnRealloc] scanmem-0.17/targetmem.h:109:39: portability: 'swath->first_byte_in_child' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:168:56: portability: '(void*)(*swath_pointer_to_correct)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:189:65: portability: '(void*)swath' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:190:50: portability: '(void*)swath+sizeof(struct matches_and_old_values_swath)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:212:58: portability: 'local_address_beyond_last_element(swath)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.h:223:58: portability: 'local_address_beyond_last_element(swath)' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/handlers.c:212:16: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/handlers.c:227:17: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/handlers.c:263:17: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/handlers.c:1190:15: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/handlers.c:1262:52: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] scanmem-0.17/handlers.c:1287:60: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] scanmem-0.17/handlers.c:452:17: error: Common realloc mistake: 'v' nulled but not freed upon failure [memleakOnRealloc] scanmem-0.17/handlers.c:465:17: error: Common realloc mistake: 'v' nulled but not freed upon failure [memleakOnRealloc] scanmem-0.17/handlers.c:1156:9: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] scanmem-0.17/handlers.c:1150:13: note: ret is assigned scanmem-0.17/handlers.c:1156:9: note: ret is overwritten scanmem-0.17/handlers.c:1156:9: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] scanmem-0.17/handlers.c:1153:13: note: ret is assigned scanmem-0.17/handlers.c:1156:9: note: ret is overwritten scanmem-0.17/handlers.c:716:54: portability: 'reg_to_delete->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/handlers.c:1411:36: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/handlers.c:1428:36: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/menu.c:119:9: warning: %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. [invalidPrintfArgType_sint] scanmem-0.17/menu.c:114:18: style: Variable 'success' is assigned a value that is never used. [unreadVariable] scanmem-0.17/maps.c:96:29: warning: Obsolete function 'alloca' called. In C99 and later it is recommended to use a variable length array instead. [allocaCalled] scanmem-0.17/maps.c:105:17: warning: %x in format string (no. 7) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] scanmem-0.17/maps.c:105:17: warning: %x in format string (no. 8) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] scanmem-0.17/maps.c:105:17: warning: %x in format string (no. 9) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] scanmem-0.17/maps.c:105:17: warning: %u in format string (no. 10) requires 'unsigned int *' but the argument type is 'signed int *'. [invalidScanfArgType_int] scanmem-0.17/maps.c:105:17: warning: sscanf() without field width limits can crash with huge input data. [invalidscanf] scanmem-0.17/ptrace.c:321:59: portability: 'reading_swath.first_byte_in_child' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:540:51: portability: 'r->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:572:98: portability: 'r->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:581:98: portability: 'r->start' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:656:50: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:697:66: portability: 'addr' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:719:50: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:719:70: portability: 'data' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:728:54: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:728:60: portability: 'addr+len' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:728:91: portability: 'data' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:728:97: portability: 'data+len' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:738:72: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:751:58: portability: 'data' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/ptrace.c:753:62: portability: 'addr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.c:127:57: warning: Either the condition '!matches' is redundant or there is possible null pointer dereference: matches. [nullPointerRedundantCheck] scanmem-0.17/targetmem.c:131:9: note: Assuming that condition '!matches' is not redundant scanmem-0.17/targetmem.c:127:57: note: Null pointer dereference scanmem-0.17/targetmem.c:162:32: style: Parameter 'start_address' can be declared as pointer to const [constParameter] scanmem-0.17/targetmem.c:63:65: portability: '(void*)swath' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.c:70:35: portability: '(void*)swath' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] scanmem-0.17/targetmem.c:179:59: portability: 'reading_swath.first_byte_in_child' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [arithOperationsOnVoidPointer] diff: head scanmem-0.17/targetmem.c:162:32: style: Parameter 'start_address' can be declared as pointer to const [constParameter] 2.8 scanmem-0.17/targetmem.c:162:32: style: Parameter 'start_address' can be declared with const [constParameter] 2.8 scanmem-0.17/targetmem.h:132:33: style: Parameter 'last_byte_to_reach_plus_one' can be declared with const [constParameter] DONE