2026-05-05 14:31 ftp://ftp.de.debian.org/debian/pool/main/u/usb-modeswitch/usb-modeswitch_2.6.2.orig.tar.bz2 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 -j1 platform: Linux-6.8.0-111-generic-x86_64-with-glibc2.39 python: 3.12.3 client-version: 1.3.70 compiler: g++ (Ubuntu 14.2.0-4ubuntu2~24.04.1) 14.2.0 cppcheck: head 2.20.0 head-info: 6278f6b (2026-05-05 15:01:04 +0200) count: 58 59 elapsed-time: 0.9 0.8 head-timing-info: old-timing-info: head results: usb-modeswitch-2.6.2/dispatcher.c:65:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable RAWSCRIPT [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:367:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable optarg [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:451:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:865:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:946:31: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable altsetting [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:984:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1013:10: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1121:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_STANDARD [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1135:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_VENDOR [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1157:4: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_CLASS [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1181:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_VENDOR [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1197:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1206:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_VENDOR [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1220:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_VENDOR [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1241:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_VENDOR [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1267:32: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_CLASS [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1325:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_VENDOR [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1409:38: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_REQUEST_TYPE_VENDOR [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1474:13: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_ERROR_NOT_SUPPORTED [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1524:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1643:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LOG_NOTICE [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1668:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_ERROR_NO_DEVICE [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1682:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable LIBUSB_ERROR_NO_DEVICE [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1779:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1842:39: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable altsetting [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1878:35: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable altsetting [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:1910:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdin [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:2072:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] usb-modeswitch-2.6.2/usb_modeswitch.c:367:14: warning:inconclusive: The buffer 'MessageContent' may not be null-terminated after the call to strncpy(). [terminateStrncpy] usb-modeswitch-2.6.2/usb_modeswitch.c:368:14: warning:inconclusive: The buffer 'MessageContent2' may not be null-terminated after the call to strncpy(). [terminateStrncpy] usb-modeswitch-2.6.2/usb_modeswitch.c:369:14: warning:inconclusive: The buffer 'MessageContent3' may not be null-terminated after the call to strncpy(). [terminateStrncpy] usb-modeswitch-2.6.2/usb_modeswitch.c:1053:2: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] usb-modeswitch-2.6.2/usb_modeswitch.c:1057:3: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] usb-modeswitch-2.6.2/usb_modeswitch.c:1086:2: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] usb-modeswitch-2.6.2/usb_modeswitch.c:1385:2: style: Obsolescent function 'usleep' called. It is recommended to use 'nanosleep' or 'setitimer' instead. [prohibitedusleepCalled] usb-modeswitch-2.6.2/usb_modeswitch.c:1752:11: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] usb-modeswitch-2.6.2/usb_modeswitch.c:1824:12: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] usb-modeswitch-2.6.2/usb_modeswitch.c:1905:12: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] usb-modeswitch-2.6.2/usb_modeswitch.c:1939:13: portability: Non reentrant function 'strtok' called. For threadsafe applications it is recommended to use the reentrant replacement function 'strtok_r'. [prohibitedstrtokCalled] usb-modeswitch-2.6.2/usb_modeswitch.c:1385:21: error: Invalid usleep() argument nr 1. The value is 2000000 but the valid values are '0:999999'. [invalidFunctionArg] usb-modeswitch-2.6.2/usb_modeswitch.c:1383:17: note: Assignment 'ReleaseDelay=2000', assigned value is 2000 usb-modeswitch-2.6.2/usb_modeswitch.c:1385:21: note: Invalid argument usb-modeswitch-2.6.2/usb_modeswitch.c:1791:20: style: The statement 'if (devClass!=ifaceClass) devClass=ifaceClass' is logically equivalent to 'devClass=ifaceClass'. [duplicateConditionalAssign] usb-modeswitch-2.6.2/usb_modeswitch.c:1792:17: note: Assignment 'devClass=ifaceClass' usb-modeswitch-2.6.2/usb_modeswitch.c:1791:20: note: Condition 'devClass!=ifaceClass' is redundant usb-modeswitch-2.6.2/usb_modeswitch.c:1431:12: style: Condition 'dev!=0' is always false [knownConditionTrueFalse] usb-modeswitch-2.6.2/usb_modeswitch.c:1426:14: note: Assuming that condition 'dev==0' is not redundant usb-modeswitch-2.6.2/usb_modeswitch.c:1431:12: note: Condition 'dev!=0' is always false usb-modeswitch-2.6.2/usb_modeswitch.c:1783:14: style: Condition 'ret<0' is always false [knownConditionTrueFalse] usb-modeswitch-2.6.2/usb_modeswitch.c:1778:14: note: Assuming that condition 'ret<0' is not redundant usb-modeswitch-2.6.2/usb_modeswitch.c:1783:14: note: Condition 'ret<0' is always false usb-modeswitch-2.6.2/usb_modeswitch.c:1728:3: error: Memory leak: listcopy [memleak] usb-modeswitch-2.6.2/usb_modeswitch.c:408:12: warning: If memory allocation fails, then there is a possible null pointer dereference: longConfig [nullPointerOutOfMemory] usb-modeswitch-2.6.2/usb_modeswitch.c:407:24: note: Assuming allocation function fails usb-modeswitch-2.6.2/usb_modeswitch.c:407:24: note: Assignment 'longConfig=malloc(strlen(optarg)+5)', assigned value is 0 usb-modeswitch-2.6.2/usb_modeswitch.c:408:12: note: Null pointer dereference usb-modeswitch-2.6.2/usb_modeswitch.c:409:12: warning: If memory allocation fails, then there is a possible null pointer dereference: longConfig [nullPointerOutOfMemory] usb-modeswitch-2.6.2/usb_modeswitch.c:407:24: note: Assuming allocation function fails usb-modeswitch-2.6.2/usb_modeswitch.c:407:24: note: Assignment 'longConfig=malloc(strlen(optarg)+5)', assigned value is 0 usb-modeswitch-2.6.2/usb_modeswitch.c:409:12: note: Null pointer dereference usb-modeswitch-2.6.2/usb_modeswitch.c:379:53: style: Consecutive return, break, continue, goto or throw statements are unnecessary. [duplicateBreak] usb-modeswitch-2.6.2/usb_modeswitch.c:1707:16: style: Local variable 'buffer' shadows outer variable [shadowVariable] usb-modeswitch-2.6.2/usb_modeswitch.c:156:15: note: Shadowed declaration usb-modeswitch-2.6.2/usb_modeswitch.c:1707:16: note: Shadow variable usb-modeswitch-2.6.2/usb_modeswitch.c:1776:38: style: Local variable 'descriptor' shadows outer variable [shadowVariable] usb-modeswitch-2.6.2/usb_modeswitch.c:1732:35: note: Shadowed declaration usb-modeswitch-2.6.2/usb_modeswitch.c:1776:38: note: Shadow variable usb-modeswitch-2.6.2/usb_modeswitch.c:1519:23: style: Parameter 'message' can be declared as pointer to const [constParameterPointer] usb-modeswitch-2.6.2/usb_modeswitch.c:1703:72: style: Parameter 'productList' can be declared as pointer to const [constParameterPointer] usb-modeswitch-2.6.2/usb_modeswitch.c:1706:24: style: Variable 'token' can be declared as pointer to const [constVariablePointer] usb-modeswitch-2.6.2/usb_modeswitch.c:1887:50: style: Parameter 'VariableName' can be declared as pointer to const [constParameterPointer] usb-modeswitch-2.6.2/usb_modeswitch.c:1891:8: style: Variable 'VarName' can be declared as pointer to const [constVariablePointer] usb-modeswitch-2.6.2/usb_modeswitch.c:1891:18: style: Variable 'Comment' can be declared as pointer to const [constVariablePointer] usb-modeswitch-2.6.2/usb_modeswitch.c:1896:8: style: Variable 'token' can be declared as pointer to const [constVariablePointer] usb-modeswitch-2.6.2/usb_modeswitch.c:2080:8: style: Variable 'version' can be declared as pointer to const [constVariablePointer] usb-modeswitch-2.6.2/usb_modeswitch.c:849:9: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] diff: 2.20.0 usb-modeswitch-2.6.2/usb_modeswitch.c:410:12: warning: If memory allocation fails, then there is a possible null pointer dereference: longConfig [nullPointerOutOfMemory] usb-modeswitch-2.6.2/usb_modeswitch.c:407:24: note: Assuming allocation function fails usb-modeswitch-2.6.2/usb_modeswitch.c:407:24: note: Assignment 'longConfig=malloc(strlen(optarg)+5)', assigned value is 0 usb-modeswitch-2.6.2/usb_modeswitch.c:410:12: note: Null pointer dereference DONE