2024-04-23 03:38 ftp://ftp.de.debian.org/debian/pool/main/w/webdis/webdis_0.1.9+dfsg.orig.tar.xz cppcheck-options: --library=posix --library=gnu --library=bsd --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 -D__GNUC__ --platform=unix64 -j1 platform: Linux-5.15.0-105-generic-x86_64-with-glibc2.35 python: 3.10.12 client-version: 1.3.56 compiler: g++ (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0 cppcheck: head 2.14.0 head-info: bd7136d (2024-04-22 21:34:48 +0200) count: 88 88 elapsed-time: 4.2 4.0 head-timing-info: old-timing-info: head results: webdis-0.1.9/src/acl.c:13:30: style: Parameter 'a' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/src/acl.c:13:72: style: Parameter 'ip' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/src/client.c:183:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable F_CONNECTION_CLOSE [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/client.c:220:31: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable HTTP_REQUEST [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/client.c:20:40: style: Parameter 'p' can be declared as pointer to const. However it seems that 'http_client_on_url' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] webdis-0.1.9/src/client.c:224:23: note: You might need to cast the function pointer here webdis-0.1.9/src/client.c:20:40: note: Parameter 'p' can be declared as pointer to const webdis-0.1.9/src/client.c:36:41: style: Parameter 'p' can be declared as pointer to const. However it seems that 'http_client_on_body' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] webdis-0.1.9/src/client.c:226:24: note: You might need to cast the function pointer here webdis-0.1.9/src/client.c:36:41: note: Parameter 'p' can be declared as pointer to const webdis-0.1.9/src/client.c:54:48: style: Parameter 'p' can be declared as pointer to const. However it seems that 'http_client_on_header_name' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] webdis-0.1.9/src/client.c:228:32: note: You might need to cast the function pointer here webdis-0.1.9/src/client.c:54:48: note: Parameter 'p' can be declared as pointer to const webdis-0.1.9/src/client.c:96:49: style: Parameter 'parser' can be declared as pointer to const. However it seems that 'http_client_on_query_string' is a callback function, if 'parser' is declared with const you might also need to cast function pointer(s). [constParameterCallback] webdis-0.1.9/src/client.c:225:32: note: You might need to cast the function pointer here webdis-0.1.9/src/client.c:96:49: note: Parameter 'parser' can be declared as pointer to const webdis-0.1.9/src/client.c:145:49: style: Parameter 'p' can be declared as pointer to const. However it seems that 'http_client_on_header_value' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] webdis-0.1.9/src/client.c:229:32: note: You might need to cast the function pointer here webdis-0.1.9/src/client.c:145:49: note: Parameter 'p' can be declared as pointer to const webdis-0.1.9/src/client.c:178:53: style: Parameter 'p' can be declared as pointer to const. However it seems that 'http_client_on_message_complete' is a callback function, if 'p' is declared with const you might also need to cast function pointer(s). [constParameterCallback] webdis-0.1.9/src/client.c:227:36: note: You might need to cast the function pointer here webdis-0.1.9/src/client.c:178:53: note: Parameter 'p' can be declared as pointer to const webdis-0.1.9/src/cmd.c:309:5: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable s [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/cmd.c:82:9: style: Variable 'tmp' can be declared as const array [constVariable] webdis-0.1.9/src/cmd.c:143:8: style: Variable 'qmark' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/cmd.c:194:10: style: Variable 'next' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/cmd.c:293:39: style: Parameter 'client' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/src/cmd.c:372:30: style: Parameter 'cmd' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/src/conf.c:46:11: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/conf.c:116:28: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable JSON_STRING [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/conf.c:149:65: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable JSON_STRING [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/conf.c:73:12: portability: Non reentrant function 'getpwnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getpwnam_r'. [prohibitedgetpwnamCalled] webdis-0.1.9/src/conf.c:78:12: portability: Non reentrant function 'getgrnam' called. For threadsafe applications it is recommended to use the reentrant replacement function 'getgrnam_r'. [prohibitedgetgrnamCalled] webdis-0.1.9/src/conf.c:72:19: style: Variable 'u' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/conf.c:77:18: style: Variable 'g' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/conf.c:151:9: style: Variable 'p' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/formats/custom-type.c:46:37: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REDIS_REPLY_STATUS [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/formats/custom-type.c:16:14: style: Variable 'reply' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/formats/custom-type.c:76:26: style: Parameter 'cmd' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/src/formats/custom-type.c:88:15: style: Variable 'e' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/formats/custom-type.c:104:15: style: Variable 'e' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/formats/json.c:106:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REDIS_REPLY_STRING [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/formats/json.c:137:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REDIS_REPLY_ERROR [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/formats/json.c:193:35: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable JSON_COMPACT [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/formats/json.c:236:23: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable JSON_ARRAY [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/formats/json.c:193:8: style: Local variable 'json_reply' shadows outer function [shadowFunction] webdis-0.1.9/src/formats/json.h:12:1: note: Shadowed declaration webdis-0.1.9/src/formats/json.c:193:8: note: Shadow variable webdis-0.1.9/src/formats/json.c:17:14: style: Variable 'reply' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/formats/msgpack.c:152:17: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REDIS_REPLY_STRING [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/formats/msgpack.c:193:18: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REDIS_REPLY_ERROR [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/formats/msgpack.c:34:14: style: Variable 'reply' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/formats/raw.c:55:47: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REDIS_ERR [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/formats/raw.c:163:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REDIS_REPLY_STATUS [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/formats/raw.c:68:15: style: Variable 'ri' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/formats/raw.c:112:15: style: Variable 'e' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/formats/raw.c:132:15: style: Variable 'e' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/src/http-parser/http_parser.c:360:9: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable F_TRAILING [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/http-parser/http_parser.c:1560:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable F_CONNECTION_CLOSE [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/http-parser/http_parser.c:1586:25: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable HTTP_REQUEST [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/http-parser/http_parser.c:1556:38: style: Parameter 'parser' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/src/http.c:182:4: portability: %zd in format string (no. 1) requires 'ssize_t' but the argument type is 'size_t {aka unsigned long}'. [invalidPrintfArgType_sint] webdis-0.1.9/src/http.c:248:57: style: Parameter 'c' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/src/http.c:177:4: style: Variable 'p' is assigned a value that is never used. [unreadVariable] webdis-0.1.9/src/pool.c:42:21: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REDIS_ERR [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/pool.c:99:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable REDIS_OK [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/server.c:34:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable AF_INET [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/server.c:116:24: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable FIONBIO [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/server.c:142:30: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable O_RDWR [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/server.c:201:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stderr [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/server.c:52:3: error: Resource leak: fd [resourceLeak] webdis-0.1.9/src/server.c:59:3: error: Resource leak: fd [resourceLeak] webdis-0.1.9/src/server.c:66:3: error: Resource leak: fd [resourceLeak] webdis-0.1.9/src/server.c:73:3: error: Resource leak: fd [resourceLeak] webdis-0.1.9/src/slog.c:29:4: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable O_WRONLY [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/slog.c:69:57: portability: Non reentrant function 'localtime' called. For threadsafe applications it is recommended to use the reentrant replacement function 'localtime_r'. [prohibitedlocaltimeCalled] webdis-0.1.9/src/slog.c:77:6: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] webdis-0.1.9/src/slog.c:76:6: note: ret is assigned webdis-0.1.9/src/slog.c:77:6: note: ret is overwritten webdis-0.1.9/src/slog.c:49:21: style: Parameter 's' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/src/websocket.c:116:64: style: Condition 'ws_compute_handshake(c,sha1_handshake,&handshake_sz)!=0' is always false [knownConditionTrueFalse] webdis-0.1.9/src/websocket.c:116:25: note: Calling function 'ws_compute_handshake' returns 0 webdis-0.1.9/src/websocket.c:116:64: note: Condition 'ws_compute_handshake(c,sha1_handshake,&handshake_sz)!=0' is always false webdis-0.1.9/src/websocket.c:352:16: style: Condition 'sz>125' is always true [knownConditionTrueFalse] webdis-0.1.9/src/websocket.c:348:8: note: Assuming that condition 'sz<=125' is not redundant webdis-0.1.9/src/websocket.c:352:16: note: Condition 'sz>125' is always true webdis-0.1.9/src/websocket.c:373:3: error: Memory leak: frame [memleak] webdis-0.1.9/src/websocket.c:359:8: style: Variable 'sz64' can be declared as const array [constVariable] webdis-0.1.9/src/worker.c:66:32: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable F_CONNECTION_CLOSE [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/worker.c:150:29: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EV_READ [valueFlowBailoutIncompleteVar] webdis-0.1.9/src/worker.c:173:34: style: Parameter 'w' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/tests/pubsub.c:45:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable AF_INET [valueFlowBailoutIncompleteVar] webdis-0.1.9/tests/pubsub.c:92:29: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EV_READ [valueFlowBailoutIncompleteVar] webdis-0.1.9/tests/pubsub.c:131:12: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable stdout [valueFlowBailoutIncompleteVar] webdis-0.1.9/tests/pubsub.c:269:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable optarg [valueFlowBailoutIncompleteVar] webdis-0.1.9/tests/pubsub.c:63:32: style: Parameter 'c' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/tests/pubsub.c:217:32: style: Parameter 'host_default' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/tests/websocket.c:63:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EV_WRITE [valueFlowBailoutIncompleteVar] webdis-0.1.9/tests/websocket.c:89:14: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EV_READ [valueFlowBailoutIncompleteVar] webdis-0.1.9/tests/websocket.c:175:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable AF_INET [valueFlowBailoutIncompleteVar] webdis-0.1.9/tests/websocket.c:253:20: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable optarg [valueFlowBailoutIncompleteVar] webdis-0.1.9/tests/websocket.c:320:3: error: Memory leak: hi.host [memleak] webdis-0.1.9/tests/websocket.c:97:16: style: Variable 'last' can be declared as pointer to const [constVariablePointer] webdis-0.1.9/tests/websocket.c:155:7: style: Variable 'ws_template' can be declared as const array [constVariable] webdis-0.1.9/tests/websocket.c:214:32: style: Parameter 'host_default' can be declared as pointer to const [constParameterPointer] webdis-0.1.9/tests/websocket.c:78:7: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] webdis-0.1.9/tests/websocket.c:95:6: style: Variable 'pos' is assigned a value that is never used. [unreadVariable] webdis-0.1.9/tests/websocket.c:112:9: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] diff: DONE